rosa-build/app/policies/comment_policy.rb

13 lines
235 B
Ruby

class CommentPolicy < ApplicationPolicy
def create?
ProjectPolicy.new(user, record.project).show?
end
alias_method :new_line?, :create?
def update?
record.user_id == user.id || local_admin?(record.project)
end
end