mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:17:32 +00:00
fix: rolecascade (#434)
* fix: project role delete * fix: project role delete
This commit is contained in:
@@ -342,14 +342,15 @@ func (es *ProjectEventstore) PrepareRemoveProjectRole(ctx context.Context, role
|
||||
func (es *ProjectEventstore) RemoveRoleFromGrants(existing *model.Project, roleKey string) []*model.ProjectGrant {
|
||||
grants := make([]*model.ProjectGrant, len(existing.Grants))
|
||||
for i, grant := range existing.Grants {
|
||||
newGrant := *grant
|
||||
roles := make([]string, 0)
|
||||
for _, role := range grant.RoleKeys {
|
||||
for _, role := range newGrant.RoleKeys {
|
||||
if role != roleKey {
|
||||
roles = append(roles, role)
|
||||
}
|
||||
}
|
||||
grant.RoleKeys = roles
|
||||
grants[i] = grant
|
||||
newGrant.RoleKeys = roles
|
||||
grants[i] = &newGrant
|
||||
}
|
||||
return grants
|
||||
}
|
||||
|
Reference in New Issue
Block a user