Skip to content

ScifeonUser

This class contains information about the currently logged on user.

import { User } from 'scifeon';
export class CustomPage {
constructor() {
if (User.isAdmin) {
// do something when admin
}
this.userId = User.id;
}
}

Returns

The currently logged in user.

The database id of the currently logged on user.

The email of the currently logged on user.

The department id of the currently logged on user.

True if the currently logged on user is active. This will always be true, as the user cannot log in if it inactive.

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.

A map of allowed roles, currently:

ADMIN

Example

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';
}
}
}