rosa-build/app/policies/issue_policy.rb

20 lines
385 B
Ruby
Raw Normal View History

class IssuePolicy < ApplicationPolicy
def index?
2015-03-19 23:31:41 +00:00
# record.project.has_issues?
true
end
def show?
return false unless record.project.has_issues?
ProjectPolicy.new(user, record.project).show?
end
alias_method :create?, :show?
alias_method :read?, :show?
def update?
is_admin? || record.user_id == user.id || local_admin?(record.project)
end
end