@nospamproxy/core
    Preparing search index...

    The template controller that can show or hide an Element based on the whether or not the user posses the required claims.

    <!-- Shows the button if the current user has 'manage:foo' claim. -->
    <button
    if-authorized.bind="{ type: 'manage', resource: 'foo' }"
    click.delegate="modify()">Save</button>

    <!-- Shows the button-control if the current user has 'manage:bar' claim as well as the additional condition described by the `isDownloadLinkAvailable` is `true`. -->
    <button-control
    if-authorized="claim.bind: {type: 'manage', resource: 'bar'}; condition.bind: isDownloadLinkAvailable">
    <normal-text value="Download"></normal-text>
    </button-control>

    <!--Can be used with else-authorized-->
    <!-- Shows the close button if the current user does not have 'manage:foo' claim. -->
    <button
    if-authorized.bind="{ type: 'manage', resource: 'foo' }"
    click.delegate="modify()">Save</button>
    <button else-authorized click.delegate="close()">Close</button>

    Implements

    • ICustomAttributeViewModel
    Index

    Constructors

    Properties

    $controller: ICustomAttributeController<IfAuthorized>
    cache: string | boolean = true
    condition: boolean = true
    elseFactory?: IViewFactory = ...
    elseView?: ISyntheticView = ...
    ifView?: ISyntheticView = ...
    view?: ISyntheticView = ...

    Methods

    • Parameters

      • _initiator: IHydratedController
      • _parent: IHydratedController

      Returns void | Promise<void>

    • Parameters

      • _initiator: IHydratedController
      • _parent: IHydratedController

      Returns Promise<void>

    • Parameters

      • newValue: unknown
      • oldValue: unknown

      Returns void | Promise<void>

    • Parameters

      • initiator: IHydratedController
      • _parent: IHydratedParentController

      Returns void | Promise<void>

    • Returns void