Skip to content

ScifeonUserHelper

This class is used in conjunction with ScifeonUser and is automatically instantiated as the static property ScifeonUser.Helper on that class.

import { User } from 'scifeon';
export class TestClass {
constructor() {
if (User.Helper.hasOneOfRoles(User.ROLE_KEYS.ADMIN)) {
this.adminMessage = 'Is admin';
}
}
}

Parameters

Returns

True when the logged on user has the role.

hasOneOfRoles(...roles: string[]): boolean

Section titled “hasOneOfRoles(...roles: string[]): boolean”

Parameters

Returns

True when the logged on user has one of the roles.

Example

See above.