Authorisation management using CanCanCan added
This commit is contained in:
parent
51be4a4777
commit
7a3b65fe50
24 changed files with 211 additions and 295 deletions
|
|
@ -22,7 +22,7 @@ class ApplicationController < ActionController::Base
|
|||
# the navigation bar that contains a paginator of packages that contain
|
||||
# screenshots that require moderation.
|
||||
def moderate_packages
|
||||
if user_signed_in? and current_user.is_admin? and Package.need_moderation.any?
|
||||
if can? :approve, Screenshot and Package.need_moderation.any?
|
||||
@moderate_packages = Package.need_moderation
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue