rosa-build/app/policies/issue_policy.rb

18 lines
293 B
Ruby
Raw Normal View History

class IssuePolicy < ApplicationPolicy
def index?
record.project.has_issues?
end
def show?
policy(record.project).show?
end
alias_method :create?, :show?
alias_method :read?, :show?
def update?
record.user_id == user.id || local_admin?(record.project)
end
end