gitlab-org--gitlab-foss/app/policies/issuable_policy.rb
2016-08-30 11:39:22 -07:00

14 lines
299 B
Ruby

class IssuablePolicy < BasePolicy
def action_name
@subject.class.name.underscore
end
def rules
if @user && (@subject.author == @user || @subject.assignee == @user)
can! :"read_#{action_name}"
can! :"update_#{action_name}"
end
delegate! @subject.project
end
end