Give us contact

Do you prefer to ask us directly?

Call us +420 605 203 938 (the Czech Republic)

or use this contacts

AyMINE

Related links


FI - Finance Management

Object scripting API – object User

Object evalGlobalObj defines functionality available for the object scripting using the user object.

Usable only in the application (locally processed) scripts.

All definitions are in the TypeScript latest edition.


export class evalUserObj {

/** Returns user ID as a number
 * @returns sysUserID of the logged user
 * 
 * Be carefull about the type control; use == not === to compare with values from database
 */
get ID(): number
/** @return sysUserID odf the logged utse as number */
get sysUserID(): number
/** @return sysClientID as a number -- be carefull about conversions */
get sysClientID(): number
/** @return selfClienID alternative name from sysClientID in case that script should distinguish values */
get selfClientID(): number

/** Check if user has right
 * @param uright in the format sys@sysUser.doSomething
 * @reutrn true if user has such right
 */
hasRight(uright: string | string[]): boolean 

/** Returns true, if user has the role.
 * * if list of roles is given, user can have any of the role to got the right
 * @param role name of the role | list of names
 */
hasRole(role: number | number[]) 

/** Returns list of roles. Only for where conditions
 * @example where: "= actors in (user.roles)"
 */
roles(): string 

/** Check, if user has access to the module */
hasModule(module: string): boolean 

/** Return set value of the module option – values defined by superadmin in the module setings */
hasModuleOption(module: string, option: string): boolean 

/** Returns text value of the text module options – values defined by superadmin in the module setings */
moduleTextOption(module: string, optName: string): string 

/** Return name of the client company */
get clientName(): string 

/** returns userlanguage
 * @param format supports values name – translated T:name, I:icon, IN:iconName, TS:short
 */
lang(format: 'T' | 'I' | 'IN' | 'TS'): string 

/** Returns language set by user as prefered for messages & translations */
get readLang(): string 

/** Returns user module info.
 * User module info is object generated by server and send to the client repeatedly during the system loading and refresh
 * Content is generated by backend function <module>Info.getUserInfo() method
 * @param module: string – name of the module
 */
mParam(module: string): object | false 

// **********************  User object initilisation    *********************

/** returns true if logged user has developer position */
get isDeveloper(): boolean

private static me: evalUserObj
static get getMe(): evalUserObj 

/** Returns true if client is  – for users that don't know each other 
 * value Kind in the client settings 
 */
get Client(): boolean 

/** Returns true if client is testing  
 * value Kind in the client settings – returns true both for test internal and test client
 * Warninig: has nothing to do with server (production / testing), value is based only on the client settings
 */
get testClient(): boolean 
   
}  // end of evaluUsrObj