getContext()



Return:

Type

Description

SimpleRecord objectThis method returns the current attribute object.

Example:

const record = new SimpleUser();
let user = record.getContext(); //user or employee attributes
ss.info(record.hasRole('admin')); //true | false
ss.info("Does this user have the security admin role? " + record.hasRole('security_admin')); // true | false
ss.info("Is the navigator menu pinned? " + record.getPreference('menu.pin')); // -1 / 0 / 1
record.setPreference('New user preference', 'Menu pinning'); 
ss.info("New preference value: " + record.getPreference('New user preference')); //Menu pinning
ss.info("not existing preference: " + record.getPreference('non-existing preference')); //null
ss.info(user.username);  //admin


getID()



Return:

TypeDescription
StringCurrent user ID.



getPreference(preferenceName)



Parameter(s):

NameTypeMandatoryDefault Value
preferenceNameStringYN


Return:

TypeDescription
StringThis method returns the specified preference value for the current user. If the specified preference does not exist, it returns NULL.




hasRole(role)



Parameter(s):

NameTypeMandatoryDefault Value
roleStringYN


Return:

TypeDescription
BooleanThis method approves or disproves an assumption whether a specified user is granted with a specified role.



setPreference(preferenceName, value)



Parameter(s):

NameTypeMandatoryDefault Value
preferenceNameStringYN
valueStringYN


Return:

TypeDescription
VoidThis method does not return a value.