2018-07-24 06:00:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-23 14:24:06 -04:00
|
|
|
class ProtectedBranchPolicy < BasePolicy
|
|
|
|
delegate { @subject.project }
|
|
|
|
|
|
|
|
rule { can?(:admin_project) }.policy do
|
2018-03-24 20:54:56 -04:00
|
|
|
enable :create_protected_branch
|
2018-03-23 14:24:06 -04:00
|
|
|
enable :update_protected_branch
|
2018-03-24 20:54:56 -04:00
|
|
|
enable :destroy_protected_branch
|
2018-03-23 14:24:06 -04:00
|
|
|
end
|
|
|
|
end
|
2019-09-13 09:26:31 -04:00
|
|
|
|
2021-05-11 17:10:21 -04:00
|
|
|
ProtectedBranchPolicy.prepend_mod_with('ProtectedBranchPolicy')
|