fix: don't allow creating an auth with instance resources (#23674)
parent
11019d2aa7
commit
b87deb49e5
|
@ -34,6 +34,11 @@ func (s *AuthedAuthorizationService) CreateAuthorization(ctx context.Context, a
|
|||
if err := authorizer.VerifyPermissions(ctx, a.Permissions); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, v := range a.Permissions {
|
||||
if v.Resource.Type == influxdb.InstanceResourceType {
|
||||
return fmt.Errorf("authorizations cannot be created with the instance type, it is only used during setup")
|
||||
}
|
||||
}
|
||||
|
||||
return s.s.CreateAuthorization(ctx, a)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue