Skip to content
代码片段 群组 项目
提交 b21f2bd4 编辑于 作者: Dmytro Biryukov's avatar Dmytro Biryukov
浏览文件

Remove FF prevent_job_token_admin_permissions

Changelog: changed
上级 0819505e
No related branches found
No related tags found
无相关合并请求
...@@ -4,7 +4,7 @@ class BasePolicy < DeclarativePolicy::Base ...@@ -4,7 +4,7 @@ class BasePolicy < DeclarativePolicy::Base
desc "User is an instance admin" desc "User is an instance admin"
with_options scope: :user, score: 0 with_options scope: :user, score: 0
condition(:admin) do condition(:admin) do
next false if ::Feature.enabled?(:prevent_job_token_admin_permissions, @user) && @user&.from_ci_job_token? next false if @user&.from_ci_job_token?
if Gitlab::CurrentSettings.admin_mode if Gitlab::CurrentSettings.admin_mode
Gitlab::Auth::CurrentUserMode.new(@user).admin_mode? Gitlab::Auth::CurrentUserMode.new(@user).admin_mode?
......
---
name: prevent_job_token_admin_permissions
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167449
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/474775
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/495627
milestone: '17.5'
type: development
group: group::pipeline security
default_enabled: false
...@@ -58,22 +58,6 @@ def policy ...@@ -58,22 +58,6 @@ def policy
it 'prevents when user is admin' do it 'prevents when user is admin' do
is_expected.to be_disallowed(ability) is_expected.to be_disallowed(ability)
end end
context 'and feature flag prevent_job_token_admin_permissions is disabled' do
before do
stub_feature_flags(prevent_job_token_admin_permissions: false)
end
it 'does not prevent settings in admin mode' do
allow(Gitlab::CurrentSettings).to receive(:admin_mode).and_return(true)
is_expected.to be_allowed(ability)
end
it 'allows when user is admin' do
is_expected.to be_allowed(ability)
end
end
end end
it 'prevented when not in admin mode' do it 'prevented when not in admin mode' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册