Skip to content

Commit

Permalink
feat: added assignment management
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryT-CG committed Feb 28, 2024
1 parent a925171 commit e55b4ad
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 132 deletions.
25 changes: 13 additions & 12 deletions src/app/permission/app-detail/app-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
</th>
<th
*ngIf="!currentApp.isApp"
[attr.colspan]="roles.length"
[attr.colspan]="roles ? roles.length : 0"
class="py-0 opacity-80 text-center"
[title]="'ROLE.TOOLTIP' | translate"
>
Expand Down Expand Up @@ -339,31 +339,32 @@
<td
*ngFor="let role of columns"
class="text-center"
[id]="'app_detail_permission_table_data_' + role.name"
[id]="'app_detail_permission_table_data_' + role.name + '_' + rowData.key"
>
<div *ngIf="!myPermissions.includes('PERMISSION#EDIT')">
<!-- display only -->
<div *ngIf="!myPermissions.includes('PERMISSION#GRANT')">
<span
*ngIf="rowData.roles[role.name]"
*ngIf="rowData.roles[role.id]"
class="pi pi-circle-fill text-primary text-lg"
[title]="'PERMISSION.ROLE_IS_ASSIGNED_1' | translate"
[title]="'PERMISSION.ASSIGNMENTS.ROLE_IS_ASSIGNED_1' | translate"
>
</span>
<span
*ngIf="!rowData.roles[role.name]"
*ngIf="!rowData.roles[role.id]"
class="pi pi-circle text-primary text-lg"
[title]="'PERMISSION.ROLE_IS_ASSIGNED_0' | translate"
[title]="'PERMISSION.ASSIGNMENTS.ROLE_IS_ASSIGNED_0' | translate"
>
</span>
</div>

<div *ngIf="myPermissions.includes('PERMISSION#EDIT')">
<div *ngIf="myPermissions.includes('PERMISSION#GRANT')">
<!-- not assigned -->
<button
pbutton
type="button"
*ngIf="!rowData.roles[role.name]"
*ngIf="!rowData.roles[role.id]"
(click)="onAssignPermission($event, rowData, role)"
[title]="'PERMISSION.ROLE_ASSIGNEMENT_CHANGEABLE' | translate"
[title]="'PERMISSION.ASSIGNMENTS.ROLE_ASSIGNEMENT_CHANGEABLE' | translate"
class="my-0 p-1 p-button-rounded font-medium p-button-text p-button p-component p-button-icon-only"
>
<span class="text-primary text-lg font-medium p-button-icon pi pi-circle" aria-hidden="true"></span>
Expand All @@ -373,9 +374,9 @@
<button
pbutton
type="button"
*ngIf="rowData.roles[role.name]"
*ngIf="rowData.roles[role.id]"
(click)="onRemovePermission($event, rowData, role)"
[title]="'PERMISSION.ROLE_ASSIGNEMENT_CHANGEABLE' | translate"
[title]="'PERMISSION.ASSIGNMENTS.ROLE_ASSIGNEMENT_CHANGEABLE' | translate"
class="my-0 p-1 p-button-rounded font-medium p-button-text p-button p-component p-button-icon-only"
>
<span
Expand Down
Loading

0 comments on commit e55b4ad

Please sign in to comment.