mirror of
https://github.com/absmach/magistrala.git
synced 2026-06-23 04:10:28 +00:00
NOISSUE - Rename Admin to SuperAdmin role
Signed-off-by: dusan <borovcanindusan1@gmail.com>
This commit is contained in:
@@ -1772,7 +1772,7 @@ func TestUpdateProfilePicture(t *testing.T) {
|
||||
},
|
||||
contentType: contentType,
|
||||
token: validToken,
|
||||
authnRes: smqauthn.Session{UserID: validID, DomainID: domainID, Role: smqauthn.AdminRole},
|
||||
authnRes: smqauthn.Session{UserID: validID, DomainID: domainID, Role: smqauthn.SuperAdminRole},
|
||||
status: http.StatusOK,
|
||||
err: nil,
|
||||
},
|
||||
|
||||
@@ -190,7 +190,7 @@ func (am *authorizationMiddleware) OAuthAddUserPolicy(ctx context.Context, user
|
||||
}
|
||||
|
||||
func (am *authorizationMiddleware) checkSuperAdmin(ctx context.Context, session authn.Session) error {
|
||||
if session.Role != authn.AdminRole {
|
||||
if session.Role != authn.SuperAdminRole {
|
||||
return svcerr.ErrSuperAdminAction
|
||||
}
|
||||
if err := am.authz.Authorize(ctx, smqauthz.PolicyReq{
|
||||
|
||||
Reference in New Issue
Block a user