Commit 36866fbe authored by Robert Speicher's avatar Robert Speicher

Merge branch 'file_lock_permissions' into 'master'

Users with master permissions cannot edit the file locks

Fixes https://gitlab.com/gitlab-org/gitlab-ee/issues/702

See merge request !494
parents 11e449e1 c702189b
module PathLocksHelper module PathLocksHelper
def can_unlock?(path_lock, current_user = @current_user) def can_unlock?(path_lock, current_user = @current_user, project = @project)
can?(current_user, :admin_locks, path_lock) || path_lock.user == current_user can?(current_user, :admin_path_locks, project) || path_lock.user == current_user
end end
def license_allows_file_locks? def license_allows_file_locks?
......
...@@ -301,7 +301,7 @@ class Ability ...@@ -301,7 +301,7 @@ class Ability
:admin_pipeline, :admin_pipeline,
:admin_environment, :admin_environment,
:admin_deployment, :admin_deployment,
:admin_locks :admin_path_locks
] ]
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment