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
bd2b57d2
Commit
bd2b57d2
authored
May 17, 2018
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bring CE-EE parity to app/services/lfs/unlock_file_service.rb
parent
be54edbf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
app/services/lfs/unlock_file_service.rb
app/services/lfs/unlock_file_service.rb
+4
-4
No files found.
app/services/lfs/unlock_file_service.rb
View file @
bd2b57d2
...
...
@@ -2,14 +2,14 @@ module Lfs
class
UnlockFileService
<
BaseService
def
execute
unless
can?
(
current_user
,
:push_code
,
project
)
raise
Gitlab
::
GitAccess
::
UnauthorizedError
,
'You have no permissions'
raise
Gitlab
::
GitAccess
::
UnauthorizedError
,
_
(
'You have no permissions'
)
end
unlock_file
rescue
Gitlab
::
GitAccess
::
UnauthorizedError
=>
ex
error
(
ex
.
message
,
403
)
rescue
ActiveRecord
::
RecordNotFound
error
(
'Lock not found'
,
404
)
error
(
_
(
'Lock not found'
)
,
404
)
rescue
=>
ex
error
(
ex
.
message
,
500
)
end
...
...
@@ -24,9 +24,9 @@ module Lfs
success
(
lock:
lock
,
http_status: :ok
)
elsif
forced
error
(
'You must have master access to force delete a lock'
,
403
)
error
(
_
(
'You must have master access to force delete a lock'
)
,
403
)
else
error
(
"
#{
lock
.
path
}
is locked by GitLab User
#{
lock
.
user_id
}
"
,
403
)
error
(
_
(
"%{lock_path} is locked by GitLab User %{lock_user_id}"
)
%
{
lock_path:
lock
.
path
,
lock_user_id:
lock
.
user_id
}
,
403
)
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