pCon.basket - Plugin Development
    Preparing search index...

    Interface AuthorizationPlugin

    Authorizes users for plugin access and retrieves user restrictions.

    • Plugin category = Authorization
    interface AuthorizationPlugin {
        isAvailable?: boolean;
        name: string;
        getUserRestrictions(): Promise<ReadonlySet<UserRestriction> | null>;
        initialize(
            pDescriptor: PluginDescriptor,
            pSettings: unknown,
        ): Promise<void>;
        isPluginAuthorized(pDescriptor: PluginDescriptor): boolean;
    }

    Hierarchy (View Summary)

    Index
    isAvailable?: boolean

    Optional, if false this plugin will not be used.

    name: string
    • Returns a set of restrictions for the current user. If null the default restrictions of the application will be used.

      Returns Promise<ReadonlySet<UserRestriction> | null>

    • Will be called once after the plugin was loaded.

      Parameters

      • pDescriptor: PluginDescriptor

        Plugin descriptor for this plugin.

      • pSettings: unknown

        Optional plugin specific settings which may be defined as part of the application settings.

      Returns Promise<void>

    • Returns true if the current user is authorized to use the given plugin. If false is returned the plugin will be unavailable for the user.

      Parameters

      Returns boolean