mirror of
https://github.com/paralus/paralus.git
synced 2026-08-24 15:47:19 +00:00
Don't allow users to delete builtin roles
This commit is contained in:
@@ -315,6 +315,9 @@ func (s *roleService) Delete(ctx context.Context, role *rolev3.Role) (*rolev3.Ro
|
||||
}
|
||||
|
||||
if rle, ok := entity.(*models.Role); ok {
|
||||
if rle.Builtin {
|
||||
return role, fmt.Errorf("builtin role '%v' cannot be deleted", name)
|
||||
}
|
||||
|
||||
tx, err := s.db.BeginTx(ctx, &sql.TxOptions{})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user