Deprecated: Ember Component isVisible has been deprecated by Ember. Use has-role or has-department helper instead.

For Ember deprecation notice, click here. This component is used to show or hide a button based on a certain permission level or department. It is similar to the same function as has-role or has-department helpers, except more robust, and designed only for a button itself.

Basic Usage:

<AuthButton @perm="admin" @type="button" @class="btn btn-sm btn-default" @click={{action "click"}}>
    Click me if you're an admin!
</AuthBlock>

See the docs for AuthComponentMixin for more details on how you can use this component.

Show:

click

Action public

Action to be called when the button is clicked.

defaultVisibility

Boolean public
This is the default visibility of the component which uses this mixin. This is used if neither perm nor department are set.


Default: true

department

String public
If supplied, the mixin checks this against a user's departments.

disabled

Boolean public

Whether or not to mark the button as 'disabled' See here for more details

isVisible

Computed Boolean private
This sets the isVisible property, computed based on all the other properties passed in.

override

String public
If supplied, this will be checked against the user's roles using the [match](MatchUtil.html) function. If it passes, it will ignore the department property.

perm

String | Array public
Permission value. This will be passed directly to the [match](MatchUtil.html) function.

type

String public

What the type of the button is See here for more details