WIP: Permissions

This commit is contained in:
aditya.chandel
2025-02-16 09:39:04 -07:00
parent 8a4da1997b
commit 80681e1757
29 changed files with 267 additions and 122 deletions
@@ -1,5 +1,4 @@
<ng-container>
<div *ngIf="root && item.visible !== false" class="layout-menuitem-root-text">{{ item.label }}</div>
<a *ngIf="(!item.routerLink || item.items) && item.visible !== false" [attr.href]="item.url"
@@ -16,7 +15,7 @@
<a *ngIf="(item.routerLink && !item.items) && item.visible !== false" (click)="itemClick($event)"
[ngClass]="item.class"
[routerLink]="item.routerLink" routerLinkActive="active-route"
[routerLinkActiveOptions]="item.routerLinkActiveOptions||{ paths: 'exact', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' }"
[routerLinkActiveOptions]="item.routerLinkActiveOptions || { paths: 'exact', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' }"
[fragment]="item.fragment" [queryParamsHandling]="item.queryParamsHandling"
[preserveFragment]="item.preserveFragment"
[skipLocationChange]="item.skipLocationChange" [replaceUrl]="item.replaceUrl" [state]="item.state"
@@ -29,7 +28,7 @@
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" *ngIf="item.items"></i>
</a>
<span *ngIf="(item.routerLink && !item.items) && item.visible !== false">
<ng-container *ngIf="item.type === 'Library' || item.type === 'Shelf'">
<ng-container *ngIf="(item.type === 'Library' || item.type === 'Shelf') && canManipulateLibrary">
<p-button
(click)="entitymenu.toggle($event)"
(mouseover)="hovered = true"
@@ -46,9 +45,14 @@
<p-menu #entitymenu [model]="item.menu" [popup]="true" appendTo="body"></p-menu>
</ng-container>
<ng-container *ngIf="item.type === 'Library' && !canManipulateLibrary">
<p class="text-[var(--primary-color)] pr-1">
{{ (item.bookCount$ | async)?.toString() || '0' }}
</p>
</ng-container>
<ng-container *ngIf="item.type === 'All Books'">
<p
class="text-[var(--primary-color)] pr-1">
<p class="text-[var(--primary-color)] pr-1">
{{ (item.bookCount$ | async)?.toString() || '0' }}
</p>
</ng-container>