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
a85b630f
Commit
a85b630f
authored
Jun 06, 2019
by
Małgorzata Ksionek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure admin can remove projects
parent
53e70157
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
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
+9
-2
No files found.
ee/app/policies/ee/project_policy.rb
View file @
a85b630f
...
@@ -210,7 +210,7 @@ module EE
...
@@ -210,7 +210,7 @@ module EE
rule
{
owner
|
reporter
}.
enable
:build_read_project
rule
{
owner
|
reporter
}.
enable
:build_read_project
rule
{
owner
&
owner_cannot_destroy_project
}.
prevent
:remove_project
rule
{
~
admin
&
owner
&
owner_cannot_destroy_project
}.
prevent
:remove_project
rule
{
archived
}.
policy
do
rule
{
archived
}.
policy
do
READONLY_FEATURES_WHEN_ARCHIVED
.
each
do
|
feature
|
READONLY_FEATURES_WHEN_ARCHIVED
.
each
do
|
feature
|
...
...
ee/spec/policies/project_policy_spec.rb
View file @
a85b630f
...
@@ -451,16 +451,23 @@ describe ProjectPolicy do
...
@@ -451,16 +451,23 @@ describe ProjectPolicy do
end
end
end
end
describe
'remove_project when default_project_deletion_protection is set to true'
do
describe
'remove_project when default_project_deletion_protection is set to true'
do
before
do
before
do
allow
(
Gitlab
::
CurrentSettings
.
current_application_settings
)
allow
(
Gitlab
::
CurrentSettings
.
current_application_settings
)
.
to
receive
(
:default_project_deletion_protection
)
{
true
}
.
to
receive
(
:default_project_deletion_protection
)
{
true
}
end
end
context
'with admin'
do
context
'with admin'
do
let
(
:current_user
)
{
admin
}
let
(
:current_user
)
{
admin
}
it
{
is_expected
.
to
be_allowed
(
:remove_project
)
}
it
{
is_expected
.
to
be_allowed
(
:remove_project
)
}
context
'who owns the project'
do
let
(
:current_user
)
{
admin
}
let
(
:project
)
{
create
(
:project
,
:public
,
namespace:
admin
.
namespace
)
}
it
{
is_expected
.
to
be_allowed
(
:remove_project
)
}
end
end
end
context
'with owner'
do
context
'with owner'
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