issuable_policy.rb 299 Bytes EditWeb IDE 1 2 3 4 5 6 7 8 9 10 11 12 13 14 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