Fix a little bug
This commit is contained in:
parent
e78e106146
commit
5479236532
|
@ -292,6 +292,7 @@ func (m *FileManager) RegisterPermission(name string, value bool) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Add the default value for this permission on the default user.
|
||||
m.DefaultUser.Permissions[name] = value
|
||||
|
||||
for _, u := range m.Users {
|
||||
|
@ -299,6 +300,11 @@ func (m *FileManager) RegisterPermission(name string, value bool) error {
|
|||
u.Permissions = map[string]bool{}
|
||||
}
|
||||
|
||||
// Bypass the user if it is already defined.
|
||||
if _, ok := u.Permissions[name]; ok {
|
||||
continue
|
||||
}
|
||||
|
||||
if u.Admin {
|
||||
u.Permissions[name] = true
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue