mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 19:44:21 +00:00
fix: user grants (#1645)
* fix: user grants * fix: add missing event type Co-authored-by: fabi <fabienne.gerschwiler@gmail.com>
This commit is contained in:
parent
f0b333c5cb
commit
b742166af5
@ -136,7 +136,7 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container
|
<ng-container
|
||||||
*ngIf="(context === UserGrantContext.GRANTED_PROJECT || context === UserGrantContext.USER || context === UserGrantContext.NONE) && loadedId && loadedId === grant.id && grantToEdit == grant.id">
|
*ngIf="(context === UserGrantContext.GRANTED_PROJECT || context === UserGrantContext.USER || context === UserGrantContext.NONE) && loadedId && loadedId === grant.projectId && grantToEdit == grant.id">
|
||||||
<cnsl-form-field class="form-field" appearance="outline">
|
<cnsl-form-field class="form-field" appearance="outline">
|
||||||
<mat-select [(ngModel)]="grant.roleKeysList" multiple
|
<mat-select [(ngModel)]="grant.roleKeysList" multiple
|
||||||
[disabled]="disableWrite || !((['user.grant.write$'] | hasRole | async) || ((context === UserGrantContext.OWNED_PROJECT ? ['user.grant.write:' + grant?.projectId] : context === UserGrantContext.GRANTED_PROJECT ? ['user.grant.write:' + grant?.id] : []) | hasRole | async))"
|
[disabled]="disableWrite || !((['user.grant.write$'] | hasRole | async) || ((context === UserGrantContext.OWNED_PROJECT ? ['user.grant.write:' + grant?.projectId] : context === UserGrantContext.GRANTED_PROJECT ? ['user.grant.write:' + grant?.id] : []) | hasRole | async))"
|
||||||
@ -165,8 +165,9 @@
|
|||||||
<i class="las la-exclamation"></i>
|
<i class="las la-exclamation"></i>
|
||||||
<span>{{'GRANTS.EMPTY' | translate}}</span>
|
<span>{{'GRANTS.EMPTY' | translate}}</span>
|
||||||
</div>
|
</div>
|
||||||
<cnsl-paginator class="paginator" #paginator [timestamp]="dataSource?.viewTimestamp" [length]="dataSource.totalResult" [pageSize]="INITIAL_PAGE_SIZE"
|
<cnsl-paginator class="paginator" #paginator [timestamp]="dataSource?.viewTimestamp"
|
||||||
[length]="dataSource.totalResult" [pageSizeOptions]="[2, 3, 25, 50, 100, 250]" (page)="changePage($event)">
|
[length]="dataSource.totalResult" [pageSize]="INITIAL_PAGE_SIZE" [length]="dataSource.totalResult"
|
||||||
|
[pageSizeOptions]="[2, 3, 25, 50, 100, 250]" (page)="changePage($event)">
|
||||||
</cnsl-paginator>
|
</cnsl-paginator>
|
||||||
</div>
|
</div>
|
||||||
</app-refresh-table>
|
</app-refresh-table>
|
||||||
|
@ -184,7 +184,7 @@ export class UserGrantsComponent implements OnInit, AfterViewInit {
|
|||||||
private getGrantRoleOptions(id: string, projectId: string): void {
|
private getGrantRoleOptions(id: string, projectId: string): void {
|
||||||
this.mgmtService.getGrantedProjectByID(projectId, id).then(resp => {
|
this.mgmtService.getGrantedProjectByID(projectId, id).then(resp => {
|
||||||
if (resp.grantedProject) {
|
if (resp.grantedProject) {
|
||||||
this.loadedId = id;
|
this.loadedId = projectId;
|
||||||
this.grantRoleOptions = resp.grantedProject?.grantedRoleKeysList;
|
this.grantRoleOptions = resp.grantedProject?.grantedRoleKeysList;
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
@ -160,6 +160,7 @@ func (wm *UserGrantPreConditionReadModel) Query() *eventstore.SearchQueryBuilder
|
|||||||
project.ProjectAddedType,
|
project.ProjectAddedType,
|
||||||
project.ProjectRemovedType,
|
project.ProjectRemovedType,
|
||||||
project.GrantAddedType,
|
project.GrantAddedType,
|
||||||
|
project.GrantChangedType,
|
||||||
project.GrantRemovedType,
|
project.GrantRemovedType,
|
||||||
project.RoleAddedType,
|
project.RoleAddedType,
|
||||||
project.RoleRemovedType)
|
project.RoleRemovedType)
|
||||||
|
Loading…
Reference in New Issue
Block a user