From b742166af51ee2c8d103cd7de311772beb179105 Mon Sep 17 00:00:00 2001 From: Max Peintner Date: Thu, 22 Apr 2021 12:03:24 +0200 Subject: [PATCH] fix: user grants (#1645) * fix: user grants * fix: add missing event type Co-authored-by: fabi --- .../src/app/modules/user-grants/user-grants.component.html | 7 ++++--- .../src/app/modules/user-grants/user-grants.component.ts | 2 +- internal/command/user_grant_model.go | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/console/src/app/modules/user-grants/user-grants.component.html b/console/src/app/modules/user-grants/user-grants.component.html index 8e686eb026..a41db84c40 100644 --- a/console/src/app/modules/user-grants/user-grants.component.html +++ b/console/src/app/modules/user-grants/user-grants.component.html @@ -136,7 +136,7 @@ + *ngIf="(context === UserGrantContext.GRANTED_PROJECT || context === UserGrantContext.USER || context === UserGrantContext.NONE) && loadedId && loadedId === grant.projectId && grantToEdit == grant.id"> {{'GRANTS.EMPTY' | translate}} - + diff --git a/console/src/app/modules/user-grants/user-grants.component.ts b/console/src/app/modules/user-grants/user-grants.component.ts index e3a3db6064..d7ff635dea 100644 --- a/console/src/app/modules/user-grants/user-grants.component.ts +++ b/console/src/app/modules/user-grants/user-grants.component.ts @@ -184,7 +184,7 @@ export class UserGrantsComponent implements OnInit, AfterViewInit { private getGrantRoleOptions(id: string, projectId: string): void { this.mgmtService.getGrantedProjectByID(projectId, id).then(resp => { if (resp.grantedProject) { - this.loadedId = id; + this.loadedId = projectId; this.grantRoleOptions = resp.grantedProject?.grantedRoleKeysList; } }).catch(error => { diff --git a/internal/command/user_grant_model.go b/internal/command/user_grant_model.go index 160c48334b..f20bc24688 100644 --- a/internal/command/user_grant_model.go +++ b/internal/command/user_grant_model.go @@ -160,6 +160,7 @@ func (wm *UserGrantPreConditionReadModel) Query() *eventstore.SearchQueryBuilder project.ProjectAddedType, project.ProjectRemovedType, project.GrantAddedType, + project.GrantChangedType, project.GrantRemovedType, project.RoleAddedType, project.RoleRemovedType)