mirror of
https://github.com/multipleof4/ntfy.git
synced 2026-10-17 17:07:53 +00:00
Review
This commit is contained in:
+2
-5
@@ -298,11 +298,8 @@ func (a *Manager) ChangeRole(username string, role Role) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Promotion to admin clears user_access rows for this user AND rows owned
|
// Full cache reload: Role changes are extremely rare.
|
||||||
// by this user (Everyone rows from their reservations). Other role changes
|
return a.maybeReloadAccessCache()
|
||||||
// are no-ops for the cache but reloading the two affected slices is cheap
|
|
||||||
// and keeps the code path uniform.
|
|
||||||
return a.maybeReloadAccessCache(username, Everyone)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// changeRoleTx changes a user's role
|
// changeRoleTx changes a user's role
|
||||||
|
|||||||
Reference in New Issue
Block a user