mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-08 06:16:37 +08:00
fix: allow login during sqlite write pressure
This commit is contained in:
@@ -78,6 +78,13 @@ func adminGrant(userID string) *model.UserPermission {
|
||||
}
|
||||
}
|
||||
|
||||
func FallbackPermissions(userID, role string) *model.UserPermission {
|
||||
if role == "admin" {
|
||||
return adminGrant(userID)
|
||||
}
|
||||
return DefaultPermissions(userID)
|
||||
}
|
||||
|
||||
// Effective returns the permission set the React UI should consume.
|
||||
// Admins skip the table entirely and get a synthetic all-grant row.
|
||||
func (s *PermissionService) Effective(ctx context.Context, userID string) (*model.UserPermission, error) {
|
||||
|
||||
Reference in New Issue
Block a user