File

libs/acl/src/lib/acl-engine/types.ts

Description

This is our main agreement on how to consume acl in an application.

Index

Properties
Methods

Methods

canEdit
canEdit(aclPath: string)
Parameters :
Name Type Optional
aclPath string No
Returns : boolean
canEdit$
canEdit$(aclPath: string)
Parameters :
Name Type Optional
aclPath string No
Returns : Observable<boolean>
canShow
canShow(aclPath: string)
Parameters :
Name Type Optional
aclPath string No
Returns : boolean
canShow$
canShow$(aclPath: string)
Parameters :
Name Type Optional
aclPath string No
Returns : Observable<boolean>
isDisabled
isDisabled(aclPath: string)
Parameters :
Name Type Optional
aclPath string No
Returns : boolean
isDisabled$
isDisabled$(aclPath: string)
Parameters :
Name Type Optional
aclPath string No
Returns : Observable<boolean>
isHidden
isHidden(aclPath: string)
Parameters :
Name Type Optional
aclPath string No
Returns : boolean
isHidden$
isHidden$(aclPath: string)
Parameters :
Name Type Optional
aclPath string No
Returns : Observable<boolean>
isReadonly
isReadonly(aclPath: string)
Parameters :
Name Type Optional
aclPath string No
Returns : boolean
isReadonly$
isReadonly$(aclPath: string)
Parameters :
Name Type Optional
aclPath string No
Returns : Observable<boolean>

Properties

unscoped
Type AclEvaluationInterface
import { Observable } from 'rxjs';

export const aclResourceStates = ['hidden', 'readonly', 'disabled'] as const;
export type AclResourceState = (typeof aclResourceStates)[number];

export const aclResetStates = ['visible', 'editable'] as const;
export type AclResetState = (typeof aclResetStates)[number];

export const aclRuleStates = [...aclResetStates, ...aclResourceStates] as const;
export type AclRuleState = AclResetState | AclResourceState;

export interface AclRule {
  active: boolean;
  path: string;
  condition: string;
  state: AclRuleState;
  defaultRule: boolean;
  dynamicFormRule?: boolean;
}

export interface AclDecision {
  path: string;
  state: AclRuleState;
  decision: boolean;
  timestamp: number;
}

export interface ExpressionStoreAdapter {
  readonly dataChanged$: Observable<unknown>;
  queryStoreValue(path: string): unknown;
}

/**
 * This is our main agreement on how to consume acl in an application.
 */
export interface AclEvaluationInterface {
  readonly unscoped: AclEvaluationInterface;

  /**
   * @deprecated
   */
  canShow(aclPath: string): boolean;
  /**
   * @deprecated
   */
  canShow$(aclPath: string): Observable<boolean>;

  canEdit(aclPath: string): boolean;
  canEdit$(aclPath: string): Observable<boolean>;

  isReadonly(aclPath: string): boolean;
  isReadonly$(aclPath: string): Observable<boolean>;

  isDisabled(aclPath: string): boolean;
  isDisabled$(aclPath: string): Observable<boolean>;

  isHidden(aclPath: string): boolean;
  isHidden$(aclPath: string): Observable<boolean>;
}

results matching ""

    No results matching ""