2015-03-18 22:02:38 +00:00
|
|
|
class IssuePolicy < ApplicationPolicy
|
|
|
|
|
|
|
|
def index?
|
2015-03-19 23:31:41 +00:00
|
|
|
# record.project.has_issues?
|
|
|
|
true
|
2015-03-18 22:02:38 +00:00
|
|
|
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
|