[v11.2.x] Identity: remove GetTypedID (#92256)
Identity: remove GetTypedID (#91745)
(cherry picked from commit bcfb66b416)
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
This commit is contained in:
co-authored by
Karl Persson
parent
7a25060fa6
commit
811307c46b
+6
-8
@@ -191,15 +191,13 @@ func (hs *HTTPServer) setDefaultFolderPermissions(ctx context.Context, orgID int
|
||||
if !hs.Cfg.RBAC.PermissionsOnCreation("folder") {
|
||||
return nil
|
||||
}
|
||||
var permissions []accesscontrol.SetResourcePermissionCommand
|
||||
var userID int64
|
||||
|
||||
namespace, id := user.GetTypedID()
|
||||
if namespace == identity.TypeUser {
|
||||
var errID error
|
||||
userID, errID = identity.IntIdentifier(namespace, id)
|
||||
if errID != nil {
|
||||
return errID
|
||||
var permissions []accesscontrol.SetResourcePermissionCommand
|
||||
|
||||
if identity.IsIdentityType(user.GetID(), identity.TypeUser) {
|
||||
userID, err := identity.UserIdentifier(user.GetID())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
permissions = append(permissions, accesscontrol.SetResourcePermissionCommand{
|
||||
|
||||
Reference in New Issue
Block a user