fix: allow login during sqlite write pressure

This commit is contained in:
ShukeBta
2026-06-11 20:06:55 +08:00
parent 7274ea19b7
commit 52d75171b2
10 changed files with 225 additions and 16 deletions
+7
View File
@@ -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) {