Commit 8e84d3ff authored by http://jneen.net/'s avatar http://jneen.net/

re-allow auditor to write when they are a team member

parent 65dd895c
......@@ -59,7 +59,9 @@ module EE
enable :read_environment
enable :read_deployment
enable :read_pages
end
rule { auditor & ~guest }.policy do
prevent :create_project
prevent :create_issue
prevent :create_note
......
......@@ -242,12 +242,28 @@ describe ProjectPolicy, models: true do
context 'auditor' do
let(:current_user) { auditor }
it do
is_expected.to be_disallowed(*developer_permissions)
is_expected.to be_disallowed(*master_permissions)
is_expected.to be_disallowed(*owner_permissions)
is_expected.to be_disallowed(*(guest_permissions - auditor_permissions))
is_expected.to be_allowed(*auditor_permissions)
context 'not a team member' do
it do
is_expected.to be_disallowed(*developer_permissions)
is_expected.to be_disallowed(*master_permissions)
is_expected.to be_disallowed(*owner_permissions)
is_expected.to be_disallowed(*(guest_permissions - auditor_permissions))
is_expected.to be_allowed(*auditor_permissions)
end
end
context 'team member' do
before do
project.team << [auditor, :guest]
end
it do
is_expected.to be_disallowed(*developer_permissions)
is_expected.to be_disallowed(*master_permissions)
is_expected.to be_disallowed(*owner_permissions)
is_expected.to be_allowed(*(guest_permissions - auditor_permissions))
is_expected.to be_allowed(*auditor_permissions)
end
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment