ScifeonUser
This class contains information about the currently logged on user.
Example
Section titled “Example”import { User } from 'scifeon';
export class CustomPage { constructor() { if (User.isAdmin) { // do something when admin } this.userId = User.id; }}Methods
Section titled “Methods”static get(): ScifeonUser
Section titled “static get(): ScifeonUser”Returns
The currently logged in user.
Properties
Section titled “Properties”static id: string
Section titled “static id: string”The database id of the currently logged on user.
static email: string
Section titled “static email: string”The email of the currently logged on user.
static displayName: string
Section titled “static displayName: string”static firstName: string
Section titled “static firstName: string”static middleNames: string
Section titled “static middleNames: string”static lastName: string
Section titled “static lastName: string”static phone: string
Section titled “static phone: string”static departmentID: string
Section titled “static departmentID: string”The department id of the currently logged on user.
static isActive: boolean
Section titled “static isActive: boolean”True if the currently logged on user is active. This will always be true, as the user cannot log in if it inactive.
static isAdmin: boolean
Section titled “static isAdmin: boolean”True if the currently logged on user is system administrator.
static Helper: [ScifeonUserHelper](scifeon-user-helper)
Section titled “static Helper: [ScifeonUserHelper](scifeon-user-helper)”An instantiated instance of the ScifeonUserHelper class.
Constants
Section titled “Constants”ROLE_KEYS: Map<string, string>
Section titled “ROLE_KEYS: Map<string, string>”A map of allowed roles, currently:
ADMINExample
This can be used in conjunction with hasOneOfRoles():
import { User } from 'scifeon';
export class TestClass { constructor() { if (User.hasOneOfRoles(User.ROLE_KEYS.ADMIN)) { this.adminMessage = 'Is admin'; } }}