Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
aoz-003
Commits
7ae26fde
Commit
7ae26fde
authored
May 11, 2017
by
Tugce Nur Tas
Committed by
Tuğçe Nur Taş
May 12, 2017
Browse files
adapt user policy, superadmin is not authorized to delete other superadmins
parent
11f1c41f
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/policies/user_policy.rb
View file @
7ae26fde
...
...
@@ -31,6 +31,6 @@ class UserPolicy < ApplicationPolicy
end
def
destroy?
@current_user
.
admin_or_
superadmin?
&&
@current_user
!=
@user
@current_user
.
superadmin?
&&
!
@user
.
superadmin?
end
end
Write
Preview
Supports
Markdown
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