NOISSUE - Rename Admin to SuperAdmin role

Signed-off-by: dusan <borovcanindusan1@gmail.com>
This commit is contained in:
dusan
2026-03-11 16:52:34 +01:00
parent 28ae84286e
commit df2446c2cc
10 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ type Role uint32
const (
UserRole Role = iota + 1
AdminRole
SuperAdminRole
)
type Session struct {
+2 -2
View File
@@ -138,7 +138,7 @@ func (a *authnMiddleware) Middleware() func(http.Handler) http.Handler {
return
}
if resp.Type == AccessToken && !opts.allowUnverifiedUser && resp.Role != AdminRole && !resp.Verified {
if resp.Type == AccessToken && !opts.allowUnverifiedUser && resp.Role != SuperAdminRole && !resp.Verified {
encodeError(w, apiutil.ErrEmailNotVerified, http.StatusUnauthorized)
return
}
@@ -151,7 +151,7 @@ func (a *authnMiddleware) Middleware() func(http.Handler) http.Handler {
}
resp.DomainID = domain
switch resp.Role {
case AdminRole:
case SuperAdminRole:
resp.DomainUserID = resp.UserID
case UserRole:
resp.DomainUserID = policies.EncodeDomainUserID(domain, resp.UserID)