mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 20:57:31 +00:00
fix: usergrant pre condition check (#1947)
* fix: usergrant pre condition check * fix: usergrant pre condition check * fix: usergrant pre condition check
This commit is contained in:
@@ -117,15 +117,18 @@ func (wm *UserGrantPreConditionReadModel) Reduce() error {
|
||||
case *project.GrantAddedEvent:
|
||||
if wm.ProjectGrantID == e.GrantID {
|
||||
wm.ProjectGrantExists = true
|
||||
wm.ExistingRoleKeys = e.RoleKeys
|
||||
}
|
||||
wm.ExistingRoleKeys = e.RoleKeys
|
||||
case *project.GrantChangedEvent:
|
||||
wm.ExistingRoleKeys = e.RoleKeys
|
||||
if wm.ProjectGrantID == e.GrantID {
|
||||
wm.ProjectGrantExists = true
|
||||
wm.ExistingRoleKeys = e.RoleKeys
|
||||
}
|
||||
case *project.GrantRemovedEvent:
|
||||
if wm.ProjectGrantID == e.GrantID {
|
||||
wm.ProjectGrantExists = false
|
||||
wm.ExistingRoleKeys = []string{}
|
||||
}
|
||||
wm.ExistingRoleKeys = []string{}
|
||||
case *project.RoleAddedEvent:
|
||||
if wm.ProjectGrantID != "" {
|
||||
continue
|
||||
|
Reference in New Issue
Block a user