AuthorizationInterface | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Interface AuthorizationInterface

    interface AuthorizationInterface {
        filterRightOn(
            right: `${string}:${string}`,
            objectIds: number[],
        ): Promise<number[]>;
        getRootObjects(rights: `${string}:${string}`[]): Promise<number[] | "all">;
        hasRight(right: `${string}:${string}`): Promise<boolean>;
        hasRightOn(
            right: `${string}:${string}`,
            object: number | "any" | "all",
        ): Promise<boolean>;
    }
    Index

    Methods

    • Filter objects on which the user has the requested right (a 'bulk' hasRightOn)

      Parameters

      • right: `${string}:${string}`

        The targetted right to check, eg system:sysop (but not eg system:fs_fullaccess which requires hasRightOn)

      • objectIds: number[]

      Returns Promise<number[]>

    • List accessible root objects for a list of rights

      Parameters

      • rights: `${string}:${string}`[]

        Rights to check. If the user has any of these rights (possibly implied) on an object, it will be returned

      Returns Promise<number[] | "all">

      The list of accessible object roots. "all" if the user has rights on all objects including any future objects

    • Check whether the user has a global right

      Parameters

      • right: `${string}:${string}`

        The global right to check, eg system:sysop (but not eg system:fs_fullaccess which requires hasRightOn)

      Returns Promise<boolean>

    • Check whether the user has a targetted right on a specific object (or inherited through its parnet)

      Parameters

      • right: `${string}:${string}`

        The targetted right to check, eg system:sysop (but not eg system:fs_fullaccess which requires hasRightOn)

      • object: number | "any" | "all"

        The target object's id or "all"/"any" to verify access to all/any object(s)

      Returns Promise<boolean>