debian-mirror-gitlab/app/policies/issuable_policy.rb
2017-08-17 22:00:37 +05:30

14 lines
278 B
Ruby

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