API Docs for: v4.0.0
Show:

UIHelpers Class

Module: UIHelpers

Item Index

Methods

Methods

isInRole

(
  • role
  • [scope]
)
Boolean static

UI helper to check if current user is in at least one of the target roles. For use in client-side templates.

Parameters:

  • role String

    Name of role or comma-seperated list of roles.

  • [scope] String optional

    Optional, name of scope to check.

Returns:

Boolean:

true if current user is in at least one of the target roles.

Example:

{{#if isInRole 'admin'}}
{{/if}}

{{#if isInRole 'editor,user'}}
{{/if}}

{{#if isInRole 'editor,user' 'scope1'}}
{{/if}}