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
a65ea302
Commit
a65ea302
authored
Feb 14, 2020
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow users on premium to delete subepics
- they can see them and should be able to remove them
parent
90fa46e2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
ee/app/controllers/groups/epic_links_controller.rb
ee/app/controllers/groups/epic_links_controller.rb
+2
-2
ee/app/services/epic_links/destroy_service.rb
ee/app/services/epic_links/destroy_service.rb
+2
-2
ee/spec/controllers/groups/epic_links_controller_spec.rb
ee/spec/controllers/groups/epic_links_controller_spec.rb
+2
-0
ee/spec/services/epic_links/destroy_service_spec.rb
ee/spec/services/epic_links/destroy_service_spec.rb
+4
-4
No files found.
ee/app/controllers/groups/epic_links_controller.rb
View file @
a65ea302
...
...
@@ -3,8 +3,8 @@
class
Groups::EpicLinksController
<
Groups
::
ApplicationController
include
EpicRelations
before_action
:check_epics_available!
,
only:
:index
before_action
:check_subepics_available!
,
only:
[
:create
,
:
destroy
,
:
update
]
before_action
:check_epics_available!
,
only:
[
:index
,
:destroy
]
before_action
:check_subepics_available!
,
only:
[
:create
,
:update
]
def
update
result
=
EpicLinks
::
UpdateService
.
new
(
child_epic
,
current_user
,
params
[
:epic
]).
execute
...
...
ee/app/services/epic_links/destroy_service.rb
View file @
a65ea302
...
...
@@ -26,8 +26,8 @@ module EpicLinks
def
permission_to_remove_relation?
child_epic
.
present?
&&
parent_epic
.
present?
&&
can?
(
current_user
,
:admin_epic
_link
,
parent_epic
)
&&
can?
(
current_user
,
:admin_epic
_link
,
child_epic
)
can?
(
current_user
,
:admin_epic
,
parent_epic
)
&&
can?
(
current_user
,
:admin_epic
,
child_epic
)
end
def
not_found_message
...
...
ee/spec/controllers/groups/epic_links_controller_spec.rb
View file @
a65ea302
...
...
@@ -176,6 +176,8 @@ describe Groups::EpicLinksController do
epic1
.
update
(
parent:
parent_epic
)
end
let
(
:features_when_forbidden
)
{
{
epics:
false
}
}
subject
{
delete
:destroy
,
params:
{
group_id:
group
,
epic_id:
parent_epic
.
to_param
,
id:
epic1
.
id
}
}
it_behaves_like
'unlicensed subepics action'
...
...
ee/spec/services/epic_links/destroy_service_spec.rb
View file @
a65ea302
...
...
@@ -45,9 +45,9 @@ describe EpicLinks::DestroyService do
described_class
.
new
(
child_epic
,
user
).
execute
end
context
'when
sub
epics feature is disabled'
do
context
'when epics feature is disabled'
do
before
do
stub_licensed_features
(
epics:
true
,
subepics:
false
)
stub_licensed_features
(
epics:
false
)
end
subject
{
remove_epic_relation
(
child_epic
)
}
...
...
@@ -55,9 +55,9 @@ describe EpicLinks::DestroyService do
include_examples
'returns not found error'
end
context
'when
sub
epics feature is enabled'
do
context
'when epics feature is enabled'
do
before
do
stub_licensed_features
(
epics:
true
,
subepics:
true
)
stub_licensed_features
(
epics:
true
)
end
context
'when the user has no permissions to remove epic relation'
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