UNPKG

@ngx-security/roles

Version:
37 lines (36 loc) 1.74 kB
import { OnDestroy } from '@angular/core'; import { Subject, SubjectDetails, SubjectService } from '@ngx-security/core'; import { Observable } from 'rxjs'; import * as i0 from "@angular/core"; export declare abstract class SubjectRolesProvider { abstract roles$: Observable<string[]>; abstract getRoles(): string[]; protected constructor(); hasRoleAsync(role: string): Observable<boolean>; hasAnyRoleAsync(roles: string[]): Observable<boolean>; hasRolesAsync(roles: string[]): Observable<boolean>; hasRole(role: string): boolean; hasAnyRole(roles: string[]): boolean; hasRoles(roles: string[]): boolean; protected _hasRole(role: string, subjectRoles?: string[]): boolean; protected _hasAnyRole(roles: string[], subjectRoles?: string[]): boolean; protected _hasRoles(roles: string[], subjectRoles?: string[]): boolean; } export declare class StandardSubjectRolesProvider<D extends SubjectDetails, S extends Subject<D>> extends SubjectRolesProvider { private subject; roles$: Observable<string[]>; constructor(subject: SubjectService<D, S>); getRoles(): string[]; static ɵfac: i0.ɵɵFactoryDeclaration<StandardSubjectRolesProvider<any, any>, never>; static ɵprov: i0.ɵɵInjectableDeclaration<StandardSubjectRolesProvider<any, any>>; } export declare class UpdatableSubjectRolesProvider extends SubjectRolesProvider implements OnDestroy { private roles; roles$: Observable<string[]>; constructor(); ngOnDestroy(): void; getRoles(): string[]; update(roles: string[]): void; static ɵfac: i0.ɵɵFactoryDeclaration<UpdatableSubjectRolesProvider, never>; static ɵprov: i0.ɵɵInjectableDeclaration<UpdatableSubjectRolesProvider>; }