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
f437a7b2
Commit
f437a7b2
authored
Aug 26, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
0c3e924e
452b5d60
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
app/policies/project_policy.rb
app/policies/project_policy.rb
+2
-0
changelogs/unreleased/sh-guard-against-orphaned-project-feature.yml
.../unreleased/sh-guard-against-orphaned-project-feature.yml
+5
-0
spec/policies/project_policy_spec.rb
spec/policies/project_policy_spec.rb
+13
-0
No files found.
app/policies/project_policy.rb
View file @
f437a7b2
...
...
@@ -502,6 +502,8 @@ class ProjectPolicy < BasePolicy
end
def
feature_available?
(
feature
)
return
false
unless
project
.
project_feature
case
project
.
project_feature
.
access_level
(
feature
)
when
ProjectFeature
::
DISABLED
false
...
...
changelogs/unreleased/sh-guard-against-orphaned-project-feature.yml
0 → 100644
View file @
f437a7b2
---
title
:
Guard against deleted project feature entry in project permissions
merge_request
:
32187
author
:
type
:
fixed
spec/policies/project_policy_spec.rb
View file @
f437a7b2
...
...
@@ -94,6 +94,19 @@ describe ProjectPolicy do
permissions
.
each
{
|
p
|
is_expected
.
not_to
be_allowed
(
p
)
}
end
context
'with no project feature'
do
subject
{
described_class
.
new
(
owner
,
project
)
}
before
do
project
.
project_feature
.
destroy
project
.
reload
end
it
'returns false'
do
is_expected
.
to
be_disallowed
(
:read_build
)
end
end
it
'does not include the read_issue permission when the issue author is not a member of the private project'
do
project
=
create
(
:project
,
:private
)
issue
=
create
(
:issue
,
project:
project
,
author:
create
(
:user
))
...
...
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