Skip to content
Snippets Groups Projects
Commit d07389ba authored by Clarissa's avatar Clarissa
Browse files

#204: added function user_can_moderate to be used in policies

parent e19dd96e
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,11 @@ class ApplicationPolicy
raise 'You must implement this method!'
end
class Scope
def user_can_moderate?
user.is_admin? || user.is_moderator?
end
class Scope < ApplicationPolicy
attr_reader :user, :scope
def initialize(user, scope)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment