mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-03 09:52:18 +00:00
fix: project role (#428)
This commit is contained in:
@@ -343,11 +343,8 @@ func (es *ProjectEventstore) PrepareRemoveProjectRole(ctx context.Context, role
|
|||||||
func (es *ProjectEventstore) RemoveRoleFromGrants(existing *model.Project, roleKey string) []*model.ProjectGrant {
|
func (es *ProjectEventstore) RemoveRoleFromGrants(existing *model.Project, roleKey string) []*model.ProjectGrant {
|
||||||
grants := make([]*model.ProjectGrant, 0)
|
grants := make([]*model.ProjectGrant, 0)
|
||||||
for _, grant := range existing.Grants {
|
for _, grant := range existing.Grants {
|
||||||
for i, role := range grant.RoleKeys {
|
for _, role := range grant.RoleKeys {
|
||||||
if role == roleKey {
|
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]
|
|
||||||
grants = append(grants, grant)
|
grants = append(grants, grant)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user