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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
382 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
class ReleasePolicy < BasePolicy
delegate { @subject.project }
2021-09-30 23:02:18 +05:30
condition(:protected_tag) do
access = ::Gitlab::UserAccess.new(@user, container: @subject.project)
!access.can_create_tag?(@subject.tag)
end
2021-10-27 15:23:28 +05:30
rule { protected_tag }.policy do
2021-09-30 23:02:18 +05:30
prevent :create_release
prevent :update_release
prevent :destroy_release
end
2019-02-15 15:39:39 +05:30
end