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
db697bdb
Commit
db697bdb
authored
Dec 05, 2019
by
Tetiana Chupryna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor feedback policy
parent
9bb72332
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
27 deletions
+5
-27
ee/app/policies/ee/project_policy.rb
ee/app/policies/ee/project_policy.rb
+1
-1
ee/spec/policies/project_policy_spec.rb
ee/spec/policies/project_policy_spec.rb
+4
-26
No files found.
ee/app/policies/ee/project_policy.rb
View file @
db697bdb
...
@@ -169,7 +169,7 @@ module EE
...
@@ -169,7 +169,7 @@ module EE
rule
{
threat_monitoring_enabled
&
(
auditor
|
can?
(
:developer_access
))
}.
enable
:read_threat_monitoring
rule
{
threat_monitoring_enabled
&
(
auditor
|
can?
(
:developer_access
))
}.
enable
:read_threat_monitoring
rule
{
can?
(
:read_
project
)
&
(
can?
(
:read_merge_request
)
|
can?
(
:read_build
)
)
}.
enable
:read_vulnerability_feedback
rule
{
can?
(
:read_
security_findings
)
}.
enable
:read_vulnerability_feedback
rule
{
dependency_scanning_enabled
&
can?
(
:download_code
)
}.
enable
:read_dependencies
rule
{
dependency_scanning_enabled
&
can?
(
:download_code
)
}.
enable
:read_dependencies
...
...
ee/spec/policies/project_policy_spec.rb
View file @
db697bdb
...
@@ -334,32 +334,10 @@ describe ProjectPolicy do
...
@@ -334,32 +334,10 @@ describe ProjectPolicy do
let
(
:current_user
)
{
admin
}
let
(
:current_user
)
{
admin
}
let
(
:project
)
{
create
(
:project
,
:private
,
namespace:
owner
.
namespace
)
}
let
(
:project
)
{
create
(
:project
,
:private
,
namespace:
owner
.
namespace
)
}
context
'with admin'
do
where
(
role:
%w[admin owner maintainer developer reporter]
)
let
(
:current_user
)
{
admin
}
it
{
is_expected
.
to
be_allowed
(
:read_vulnerability_feedback
)
}
end
context
'with owner'
do
let
(
:current_user
)
{
owner
}
it
{
is_expected
.
to
be_allowed
(
:read_vulnerability_feedback
)
}
end
context
'with maintainer'
do
let
(
:current_user
)
{
maintainer
}
it
{
is_expected
.
to
be_allowed
(
:read_vulnerability_feedback
)
}
end
context
'with developer'
do
let
(
:current_user
)
{
developer
}
it
{
is_expected
.
to
be_allowed
(
:read_vulnerability_feedback
)
}
end
context
'with reporter'
do
with_them
do
let
(
:current_user
)
{
reporter
}
let
(
:current_user
)
{
public_send
(
role
)
}
it
{
is_expected
.
to
be_allowed
(
:read_vulnerability_feedback
)
}
it
{
is_expected
.
to
be_allowed
(
:read_vulnerability_feedback
)
}
end
end
...
@@ -367,7 +345,7 @@ describe ProjectPolicy do
...
@@ -367,7 +345,7 @@ describe ProjectPolicy do
context
'with guest'
do
context
'with guest'
do
let
(
:current_user
)
{
guest
}
let
(
:current_user
)
{
guest
}
it
{
is_expected
.
to
be_allowed
(
:read_vulnerability_feedback
)
}
it
{
is_expected
.
to
be_
dis
allowed
(
:read_vulnerability_feedback
)
}
end
end
context
'with non member'
do
context
'with non member'
do
...
...
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