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
5dc047dc
Commit
5dc047dc
authored
Feb 11, 2019
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable board policies when issues are disabled
Board list policies are also included
parent
e927833b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
app/policies/project_policy.rb
app/policies/project_policy.rb
+2
-0
changelogs/unreleased/security-2798-fix-boards-policy.yml
changelogs/unreleased/security-2798-fix-boards-policy.yml
+5
-0
spec/policies/project_policy_spec.rb
spec/policies/project_policy_spec.rb
+12
-8
No files found.
app/policies/project_policy.rb
View file @
5dc047dc
...
...
@@ -299,6 +299,8 @@ class ProjectPolicy < BasePolicy
rule
{
issues_disabled
}.
policy
do
prevent
(
*
create_read_update_admin_destroy
(
:issue
))
prevent
(
*
create_read_update_admin_destroy
(
:board
))
prevent
(
*
create_read_update_admin_destroy
(
:list
))
end
rule
{
merge_requests_disabled
|
repository_disabled
}.
policy
do
...
...
changelogs/unreleased/security-2798-fix-boards-policy.yml
0 → 100644
View file @
5dc047dc
---
title
:
Disable issue boards API when issues are disabled
merge_request
:
author
:
type
:
security
spec/policies/project_policy_spec.rb
View file @
5dc047dc
...
...
@@ -130,25 +130,29 @@ describe ProjectPolicy do
subject
{
described_class
.
new
(
owner
,
project
)
}
context
'when the feature is disabled'
do
it
'does not include the issues permissions'
do
before
do
project
.
issues_enabled
=
false
project
.
save!
end
it
'does not include the issues permissions'
do
expect_disallowed
:read_issue
,
:read_issue_iid
,
:create_issue
,
:update_issue
,
:admin_issue
end
it
'disables boards and lists permissions'
do
expect_disallowed
:read_board
,
:create_board
,
:update_board
,
:admin_board
expect_disallowed
:read_list
,
:create_list
,
:update_list
,
:admin_list
end
context
'when the feature is disabled and
external tracker configured'
do
context
'when
external tracker configured'
do
it
'does not include the issues permissions'
do
create
(
:jira_service
,
project:
project
)
project
.
issues_enabled
=
false
project
.
save!
expect_disallowed
:read_issue
,
:read_issue_iid
,
:create_issue
,
:update_issue
,
:admin_issue
end
end
end
end
context
'merge requests feature'
do
subject
{
described_class
.
new
(
owner
,
project
)
}
...
...
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