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

For Ember deprecation notice, click here. Basic mixin to be implemented in various components that enables showing or hiding it based on auth permissions

To use in a component:

// app/components/some-component.js
import Ember from 'ember';
import AuthComponentMixin from '@bennerinformatics/ember-fw-gc/mixins/auth-component';

export default Ember.Component.extend(AuthComponentMixin, {
    // your code here....
});

This is used in the AuthBlock and AuthButton components. You are able to use this in your own components too, but it is likely that you will never call this component directly.

Show:

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.

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 function. If it passes, it will ignore the department property.

perm

String | Array public

Permission value. This will be passed directly to the match function.