ScifeonUserHelper
This class is used in conjunction with ScifeonUser and is automatically instantiated as the static property ScifeonUser.Helper on that class.
Example
Section titled “Example”import { User } from 'scifeon';
export class TestClass { constructor() { if (User.Helper.hasOneOfRoles(User.ROLE_KEYS.ADMIN)) { this.adminMessage = 'Is admin'; } }}Methods
Section titled “Methods”hasRole(role: string): boolean
Section titled “hasRole(role: string): boolean”Parameters
role: stringA string from the mapScifeonUser.ROLE_KEYS
Returns
True when the logged on user has the role.
hasOneOfRoles(...roles: string[]): boolean
Section titled “hasOneOfRoles(...roles: string[]): boolean”Parameters
...roles: string[]An array of strings from the mapScifeonUser.ROLE_KEYS
Returns
True when the logged on user has one of the roles.
Example
See above.