Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8e84d3ff
Commit
8e84d3ff
authored
Jul 06, 2017
by
http://jneen.net/
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-allow auditor to write when they are a team member
parent
65dd895c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
app/policies/ee/project_policy.rb
app/policies/ee/project_policy.rb
+2
-0
spec/policies/project_policy_spec.rb
spec/policies/project_policy_spec.rb
+22
-6
No files found.
app/policies/ee/project_policy.rb
View file @
8e84d3ff
...
...
@@ -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
...
...
spec/policies/project_policy_spec.rb
View file @
8e84d3ff
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment