Skip to content
Snippets Groups Projects
Commit ee4ca8e0 authored by Amy Phillips's avatar Amy Phillips
Browse files

Merge branch 'revert-protected-environments-group-access-inheritence-14-9'...

Merge branch 'revert-protected-environments-group-access-inheritence-14-9' into '14-9-stable-ee-patch-3'

Revert Protected Environment group access inheritence

See merge request gitlab-org/gitlab!84685
parents d0da8976 488fd8f3
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -22,7 +22,7 @@ class ProtectedEnvironment::DeployAccessLevel < ApplicationRecord
return false unless user
return true if user.admin?
return user.id == user_id if user_type?
return group.member?(user) if group_type?
return group.users.exists?(user.id) if group_type?
 
protected_environment.container_access_level(user) >= access_level
end
Loading
Loading
Loading
Loading
@@ -70,19 +70,6 @@ RSpec.describe ProtectedEnvironment::DeployAccessLevel do
it { is_expected.to be_truthy }
end
 
context 'when there is an inherited member of a group' do
let_it_be(:parent_group) { create(:group) }
let_it_be(:child_group) { create(:group, parent: parent_group, projects: [project])}
let(:deploy_access_level) { create(:protected_environment_deploy_access_level, protected_environment: protected_environment, group: child_group) }
before do
parent_group.add_reporter(user)
end
it { is_expected.to be_truthy }
end
context 'when no permissions have been given to a group' do
let(:deploy_access_level) { create(:protected_environment_deploy_access_level, protected_environment: protected_environment) }
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment