MT AuthZ: Resolve renderer permissions in MT authZ service (#99362)
* resolve renderer permissions in MT authZ service * also include DS read perms * fix tests and linting
This commit is contained in:
@@ -41,9 +41,13 @@ func (c *Render) Authenticate(ctx context.Context, r *authn.Request) (*authn.Ide
|
||||
}
|
||||
|
||||
if renderUsr.UserID <= 0 {
|
||||
identityType := claims.TypeAnonymous
|
||||
if org.RoleType(renderUsr.OrgRole) == org.RoleAdmin {
|
||||
identityType = claims.TypeRenderService
|
||||
}
|
||||
return &authn.Identity{
|
||||
ID: "0",
|
||||
Type: claims.TypeRenderService,
|
||||
Type: identityType,
|
||||
OrgID: renderUsr.OrgID,
|
||||
OrgRoles: map[int64]org.RoleType{renderUsr.OrgID: org.RoleType(renderUsr.OrgRole)},
|
||||
ClientParams: authn.ClientParams{SyncPermissions: true},
|
||||
|
||||
Reference in New Issue
Block a user