Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @interface-technologies/permissions

Index

Type aliases

ConvenientGet

ConvenientGet<TQueryTuple>: <T>(queryObj: T) => CancellablePromise<{ [ K in keyof T]: boolean }>

Type parameters

  • TQueryTuple

Type declaration

    • <T>(queryObj: T): CancellablePromise<{ [ K in keyof T]: boolean }>
    • Type parameters

      • T: {}

      Parameters

      • queryObj: T

      Returns CancellablePromise<{ [ K in keyof T]: boolean }>

GetPermissionsApiMethod

GetPermissionsApiMethod: (q: string[]) => CancellablePromise<PermissionDto[]>

Type declaration

UsePermissions

UsePermissions<TQueryTuple>: <T>(options: Options<T>) => { [ K in keyof T]: boolean }

Type parameters

  • TQueryTuple

Type declaration

    • <T>(options: Options<T>): { [ K in keyof T]: boolean }
    • Type parameters

      • T: {}

      Parameters

      Returns { [ K in keyof T]: boolean }

Functions

convenientGetFactory

usePermissionsFactory

  • Use the factory to get a React hook:

    const usePermissions = usePermissionsFactory<AppPermissionsQueryTuple>(
    api.appPermissions.get
    )

    In a component:

    const query = useMemo(() => ({
    canViewAudit: [PermissionName.CanViewAudit]
    }), [])

    const { canViewAudit } = usePermissions(
    query,
    onReady: () => {
    // do something
    },
    )

    Type parameters

    • TQueryTuple

    Parameters

    Returns UsePermissions<TQueryTuple>

Generated using TypeDoc