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
09b102fa
Commit
09b102fa
authored
Nov 19, 2019
by
Etienne Baqué
Committed by
Nick Thomas
Nov 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed release edit url for user not allowed to update
parent
0cc472cd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
5 deletions
+16
-5
app/presenters/release_presenter.rb
app/presenters/release_presenter.rb
+2
-1
changelogs/unreleased/36257-hide-edit-for-nonallowed.yml
changelogs/unreleased/36257-hide-edit-for-nonallowed.yml
+5
-0
spec/fixtures/api/schemas/public_api/v4/release.json
spec/fixtures/api/schemas/public_api/v4/release.json
+1
-1
spec/fixtures/api/schemas/public_api/v4/release/release_for_guest.json
.../api/schemas/public_api/v4/release/release_for_guest.json
+2
-3
spec/presenters/release_presenter_spec.rb
spec/presenters/release_presenter_spec.rb
+6
-0
No files found.
app/presenters/release_presenter.rb
View file @
09b102fa
...
@@ -58,6 +58,7 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated
...
@@ -58,6 +58,7 @@ class ReleasePresenter < Gitlab::View::Presenter::Delegated
end
end
def
release_edit_page_available?
def
release_edit_page_available?
::
Feature
.
enabled?
(
:release_edit_page
,
project
,
default_enabled:
true
)
::
Feature
.
enabled?
(
:release_edit_page
,
project
,
default_enabled:
true
)
&&
can?
(
current_user
,
:update_release
,
release
)
end
end
end
end
changelogs/unreleased/36257-hide-edit-for-nonallowed.yml
0 → 100644
View file @
09b102fa
---
title
:
Remove Release edit url for users not allowed to update a release
merge_request
:
20136
author
:
type
:
fixed
spec/fixtures/api/schemas/public_api/v4/release.json
View file @
09b102fa
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
"additionalProperties"
:
false
"additionalProperties"
:
false
},
},
"_links"
:
{
"_links"
:
{
"required"
:
[
"merge_requests_url"
,
"issues_url"
,
"edit_url"
],
"required"
:
[
"merge_requests_url"
,
"issues_url"
],
"properties"
:
{
"properties"
:
{
"merge_requests_url"
:
{
"type"
:
"string"
},
"merge_requests_url"
:
{
"type"
:
"string"
},
"issues_url"
:
{
"type"
:
"string"
},
"issues_url"
:
{
"type"
:
"string"
},
...
...
spec/fixtures/api/schemas/public_api/v4/release/release_for_guest.json
View file @
09b102fa
...
@@ -26,11 +26,10 @@
...
@@ -26,11 +26,10 @@
"additionalProperties"
:
false
"additionalProperties"
:
false
},
},
"_links"
:
{
"_links"
:
{
"required"
:
[
"merge_requests_url"
,
"issues_url"
,
"edit_url"
],
"required"
:
[
"merge_requests_url"
,
"issues_url"
],
"properties"
:
{
"properties"
:
{
"merge_requests_url"
:
{
"type"
:
"string"
},
"merge_requests_url"
:
{
"type"
:
"string"
},
"issues_url"
:
{
"type"
:
"string"
},
"issues_url"
:
{
"type"
:
"string"
}
"edit_url"
:
{
"type"
:
"string"
}
}
}
}
}
},
},
...
...
spec/presenters/release_presenter_spec.rb
View file @
09b102fa
...
@@ -97,5 +97,11 @@ describe ReleasePresenter do
...
@@ -97,5 +97,11 @@ describe ReleasePresenter do
it
{
is_expected
.
to
be_nil
}
it
{
is_expected
.
to
be_nil
}
end
end
context
'when a user is not allowed to update a release'
do
let
(
:presenter
)
{
described_class
.
new
(
release
,
current_user:
guest
)
}
it
{
is_expected
.
to
be_nil
}
end
end
end
end
end
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