debian-mirror-gitlab/app/policies/issuable_policy.rb

15 lines
299 B
Ruby
Raw Normal View History

2016-09-29 09:46:39 +05:30
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