Skip to content
Snippets Groups Projects
Commit 488fd8f3 authored by Shinya Maeda's avatar Shinya Maeda
Browse files

Revert Protected Environment group access inheritence

This commit reverts the group access inhertience in
protected environments.

Changelog: fixed
parent d0da8976
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