IAM - Fix error messages for resource permissions endpoints (#85773)

* IAM: fix many error messages in access-related code to provide more information

* Remove debug statement

* Refactor resourcepermissions package to use errutil

* Replace a few more errors with errutil and wrap errors found in users and teams services

* Apply diff of openAPI spec
This commit is contained in:
Aaron Godin
2024-04-17 08:53:28 -05:00
committed by GitHub
parent 60abf01526
commit d409d8e860
9 changed files with 140 additions and 26 deletions
+1 -1
View File
@@ -388,7 +388,7 @@ func ValidateBuiltInRoles(builtInRoles []string) error {
return ErrNoneRoleAssignment
}
if !org.RoleType(br).IsValid() && br != RoleGrafanaAdmin {
return fmt.Errorf("'%s' %w", br, ErrInvalidBuiltinRole)
return ErrInvalidBuiltinRole.Build(ErrInvalidBuiltinRoleData(br))
}
}
return nil