update permissions paths/directives
This commit is contained in:
parent
1a4e79529b
commit
39e862b129
@ -21,10 +21,6 @@ export class IqserAllowDirective extends IqserPermissionsDirective implements On
|
||||
static ngTemplateGuard_allow: 'binding';
|
||||
#deny?: string | List;
|
||||
|
||||
constructor(templateRef: TemplateRef<unknown>) {
|
||||
super(templateRef);
|
||||
}
|
||||
|
||||
@Input()
|
||||
set allow(value: string | List) {
|
||||
this.setPermissions(value);
|
||||
|
||||
@ -20,10 +20,6 @@ export class IqserDenyDirective extends IqserPermissionsDirective implements OnD
|
||||
*/
|
||||
static ngTemplateGuard_deny: 'binding';
|
||||
|
||||
constructor(templateRef: TemplateRef<unknown>) {
|
||||
super(templateRef);
|
||||
}
|
||||
|
||||
@Input()
|
||||
set deny(value: string | List) {
|
||||
this.setPermissions(value);
|
||||
|
||||
@ -29,7 +29,7 @@ export abstract class IqserPermissionsDirective implements OnDestroy, OnInit {
|
||||
protected readonly _viewContainer = inject(ViewContainerRef);
|
||||
protected readonly _changeDetector = inject(ChangeDetectorRef);
|
||||
protected _permissions?: string | List;
|
||||
protected _thenTemplateRef: TemplateRef<unknown>;
|
||||
protected _thenTemplateRef = inject(TemplateRef<unknown>);
|
||||
protected _elseTemplateRef?: TemplateRef<unknown>;
|
||||
protected _thenViewRef: EmbeddedViewRef<unknown> | boolean = false;
|
||||
protected _elseViewRef: EmbeddedViewRef<unknown> | boolean = false;
|
||||
@ -37,9 +37,7 @@ export abstract class IqserPermissionsDirective implements OnDestroy, OnInit {
|
||||
protected readonly _subscription = new Subscription();
|
||||
protected readonly _if = new BehaviorSubject<Promise<boolean> | Observable<boolean>>(of(true));
|
||||
|
||||
protected constructor(templateRef: TemplateRef<unknown>) {
|
||||
this._thenTemplateRef = templateRef;
|
||||
|
||||
protected constructor() {
|
||||
const ifCondition$ = this._if.pipe(switchMap(condition => condition));
|
||||
|
||||
this._subscription = combineLatest([ifCondition$, this._updateView])
|
||||
|
||||
@ -3,4 +3,6 @@ export * from './services/permissions-guard.service';
|
||||
export * from './services/permissions.service';
|
||||
export * from './services/roles.service';
|
||||
export * from './directives/permissions.directive';
|
||||
export * from './directives/allow.directive';
|
||||
export * from './directives/deny.directive';
|
||||
export * from './utils';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user