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
7599d8c1
Commit
7599d8c1
authored
Jan 06, 2021
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Block confidential quick action for test cases
Hide /confidential quick action for issues with test case type
parent
45be2c38
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
2 deletions
+26
-2
app/models/concerns/issue_available_features.rb
app/models/concerns/issue_available_features.rb
+2
-1
ee/changelogs/unreleased/issue_270585-block_confidential_quick_action.yml
...released/issue_270585-block_confidential_quick_action.yml
+5
-0
ee/spec/services/quick_actions/interpret_service_spec.rb
ee/spec/services/quick_actions/interpret_service_spec.rb
+12
-0
lib/gitlab/quick_actions/issue_actions.rb
lib/gitlab/quick_actions/issue_actions.rb
+2
-1
spec/services/quick_actions/interpret_service_spec.rb
spec/services/quick_actions/interpret_service_spec.rb
+5
-0
No files found.
app/models/concerns/issue_available_features.rb
View file @
7599d8c1
...
...
@@ -10,7 +10,8 @@ module IssueAvailableFeatures
# EE only features are listed on EE::IssueAvailableFeatures
def
available_features_for_issue_types
{
assignee:
%w(issue incident)
assignee:
%w(issue incident)
,
confidentiality:
%(issue incident)
}.
with_indifferent_access
end
end
...
...
ee/changelogs/unreleased/issue_270585-block_confidential_quick_action.yml
0 → 100644
View file @
7599d8c1
---
title
:
Block confidential quick action for test cases
merge_request
:
50460
author
:
type
:
other
ee/spec/services/quick_actions/interpret_service_spec.rb
View file @
7599d8c1
...
...
@@ -989,6 +989,18 @@ RSpec.describe QuickActions::InterpretService do
let
(
:issuable
)
{
build
(
:merge_request
,
source_project:
project
)
}
end
end
context
'confidential command'
do
context
'for test cases'
do
it
'does not mark to update confidential attribute'
do
issuable
=
create
(
:quality_test_case
,
project:
project
)
_
,
updates
,
_
=
service
.
execute
(
'/confidential'
,
issuable
)
expect
(
updates
[
:confidential
]).
to
eq
(
nil
)
end
end
end
end
describe
'#explain'
do
...
...
lib/gitlab/quick_actions/issue_actions.rb
View file @
7599d8c1
...
...
@@ -170,7 +170,8 @@ module Gitlab
end
types
Issue
condition
do
!
quick_action_target
.
confidential?
&&
quick_action_target
.
issue_type_supports?
(
:confidentiality
)
&&
!
quick_action_target
.
confidential?
&&
current_user
.
can?
(
:"admin_
#{
quick_action_target
.
to_ability_name
}
"
,
quick_action_target
)
end
command
:confidential
do
...
...
spec/services/quick_actions/interpret_service_spec.rb
View file @
7599d8c1
...
...
@@ -1142,6 +1142,11 @@ RSpec.describe QuickActions::InterpretService do
let
(
:issuable
)
{
issue
}
end
it_behaves_like
'confidential command'
do
let
(
:content
)
{
'/confidential'
}
let
(
:issuable
)
{
create
(
:incident
,
project:
project
)
}
end
it_behaves_like
'lock command'
do
let
(
:content
)
{
'/lock'
}
let
(
:issuable
)
{
issue
}
...
...
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