Forgot to run tests
This commit is contained in:
parent
7004e14a88
commit
eee196507b
3 changed files with 13 additions and 15 deletions
|
|
@ -1,6 +1,6 @@
|
|||
class AdminController < ApplicationController
|
||||
# before_action :authenticate_user!
|
||||
# before_action :admin_only
|
||||
before_action :authenticate_user!
|
||||
before_action :admin_only
|
||||
|
||||
# def status
|
||||
# end
|
||||
|
|
@ -28,11 +28,11 @@ class AdminController < ApplicationController
|
|||
|
||||
# private
|
||||
|
||||
# def admin_only
|
||||
# unless current_user.is_admin?
|
||||
# head :forbidden
|
||||
# # redirect_to :back, :alert => "Access denied."
|
||||
# end
|
||||
# end
|
||||
def admin_only
|
||||
unless current_user.admin_role?
|
||||
head :forbidden
|
||||
# redirect_to :back, :alert => "Access denied."
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
.cell.pkgcard data-equalizer-watch=true
|
||||
a.black href=package_path(name: pkg.name)
|
||||
.image
|
||||
= small_img(screenshots_visible_to_user(pkg, session).first, cls: '')
|
||||
= small_img(pkg.screenshots.accessible_by(current_ability, :view).first, cls: '')
|
||||
.text.pkgname
|
||||
= pkg.name
|
||||
.text
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
.small-12.medium-4.cell.pkgcard
|
||||
a.black href=package_path(name: pkg.name)
|
||||
.image
|
||||
= small_img(screenshots_visible_to_user(pkg, session).first, cls: '')
|
||||
= small_img(pkg.screenshots.accessible_by(current_ability, :view).first, cls: '')
|
||||
.small-12.medium-8.cell
|
||||
h2
|
||||
a href=package_path(name: pkg.name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue