MScript Functions

Top  Previous  Next

Once the Security component is configured with SecurityDomain element, the following MScript functions become available for use everwhere where MScript is used.

mor.Security.userInfo(user-attribute-name[,security-domain-name])

mor.Security.userName([security-domain-name])

mor.Security.userId([security-domain-name])

mor.Security.hasAuthority(checkpoint-name[,security-domain-name])

 

user-attribute-name

The name of a user attribute. Valid values: username, id, fullname, email, and additional user attributes if available.

 

checkpoint-name

The name of the checkpoint to check the authority of the user.

 

security-domain-name

The name of the security domain. The default value for this optional parameter is 'main'.

 

Examples:

@set(x,'User Full Name : ' + mor.Security.userInfo('fullname') )

INSERT INTO LOG (TEXT) VALUES('Record updated by ' + mor.Security.userName() )
SELECT * FROM ORDER WHERE USER_ID = @mor.Security.userId()
 
@doif(mor.Security.hasAuthority('CAN_UPDATE_CUSTOMER_LIST'))
  UPDATE CUSTOMERS SET
  ...
@doend()