comment policy and test updates
This commit is contained in:
1 parent
906b62247b
commit
a8c42af3de
5 files changed
+64
-19
No files matched your search
@@ -2,20 +2,18 @@
|
||||
class QuizCommentPolicy < ApplicationPolicy
|
||||
# Quiz Comment Policy
|
||||
#
|
||||
# Anyone with access to the results can comment
|
||||
# Only Comment owner can edit
|
||||
# Anyone who can vote on results, can comment
|
||||
# Only comment owner can edit her comment
|
||||
|
||||
def new?
|
||||
user.acts_as_reviewer?
|
||||
end
|
||||
|
||||
def create?
|
||||
user.acts_as_reviewer?
|
||||
user.acts_as_reviewer? && record.candidate.reviewers.where(id: user.id).count.positive?
|
||||
end
|
||||
|
||||
def update?
|
||||
user.acts_as_reviewer? && user.id == record.user_id
|
||||
end
|
||||
|
||||
class Scope < Scope
|
||||
def resolve
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user