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
1149d2c9
Commit
1149d2c9
authored
Jun 11, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
01af6fc2
f4cb71d3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
10 deletions
+6
-10
app/policies/project_policy.rb
app/policies/project_policy.rb
+1
-0
lib/api/issues.rb
lib/api/issues.rb
+3
-8
spec/policies/project_policy_spec.rb
spec/policies/project_policy_spec.rb
+1
-1
spec/support/shared_contexts/policies/project_policy_shared_context.rb
...shared_contexts/policies/project_policy_shared_context.rb
+1
-1
No files found.
app/policies/project_policy.rb
View file @
1149d2c9
...
...
@@ -164,6 +164,7 @@ class ProjectPolicy < BasePolicy
enable
:set_issue_iid
enable
:set_issue_created_at
enable
:set_issue_updated_at
enable
:set_note_created_at
end
...
...
lib/api/issues.rb
View file @
1149d2c9
...
...
@@ -252,14 +252,9 @@ module API
issue
=
user_project
.
issues
.
find_by!
(
iid:
params
.
delete
(
:issue_iid
))
authorize!
:update_issue
,
issue
# Setting updated_at only allowed for admins and owners as well
if
params
[
:updated_at
].
present?
if
current_user
.
admin?
||
user_project
.
owner
==
current_user
||
current_user
.
owned_groups
.
include?
(
user_project
.
owner
)
# Setting updated_at is allowed only for admins and owners
params
.
delete
(
:updated_at
)
unless
current_user
.
can?
(
:set_issue_updated_at
,
user_project
)
issue
.
system_note_timestamp
=
params
[
:updated_at
]
else
params
.
delete
(
:updated_at
)
end
end
update_params
=
declared_params
(
include_missing:
false
).
merge
(
request:
request
,
api:
true
)
...
...
spec/policies/project_policy_spec.rb
View file @
1149d2c9
...
...
@@ -66,7 +66,7 @@ describe ProjectPolicy do
%i[
change_namespace change_visibility_level rename_project remove_project
archive_project remove_fork_project destroy_merge_request destroy_issue
set_issue_iid set_issue_created_at set_note_created_at
set_issue_iid set_issue_created_at set_
issue_updated_at set_
note_created_at
]
end
...
...
spec/support/shared_contexts/policies/project_policy_shared_context.rb
View file @
1149d2c9
...
...
@@ -64,7 +64,7 @@ RSpec.shared_context 'ProjectPolicy context' do
%i[
change_namespace change_visibility_level rename_project remove_project
archive_project remove_fork_project destroy_merge_request destroy_issue
set_issue_iid set_issue_created_at set_note_created_at
set_issue_iid set_issue_created_at set_
issue_updated_at set_
note_created_at
]
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