mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
make user an admin only if user is the first one after the deleted user.
This commit is contained in:
parent
0d51220a8c
commit
57c73f9eae
1 changed files with 3 additions and 1 deletions
|
|
@ -114,7 +114,9 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def setup_role
|
||||
self.is_admin = true if User.count == 1
|
||||
if User.count == 1 && User.first.email == 'deleted@localhost.osem'
|
||||
self.is_admin = true
|
||||
end
|
||||
end
|
||||
|
||||
# Gets the roles of the user, groups them by role.name and returns the resource(s) of each role
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue