mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-04 06:35:12 +00:00
fix: project role (#428)
This commit is contained in:
parent
6128c0c672
commit
49a3339425
@ -343,11 +343,8 @@ func (es *ProjectEventstore) PrepareRemoveProjectRole(ctx context.Context, role
|
||||
func (es *ProjectEventstore) RemoveRoleFromGrants(existing *model.Project, roleKey string) []*model.ProjectGrant {
|
||||
grants := make([]*model.ProjectGrant, 0)
|
||||
for _, grant := range existing.Grants {
|
||||
for i, role := range grant.RoleKeys {
|
||||
if role == roleKey {
|
||||
grant.RoleKeys[i] = grant.RoleKeys[len(grant.RoleKeys)-1]
|
||||
grant.RoleKeys[len(grant.RoleKeys)-1] = ""
|
||||
grant.RoleKeys = grant.RoleKeys[:len(grant.RoleKeys)-1]
|
||||
for _, role := range grant.RoleKeys {
|
||||
if role != roleKey {
|
||||
grants = append(grants, grant)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user