security/user
Documentation
- source: security/user.ts
Overview
Classes
User
getName()
Retrieves the principal name (username or ID) of the currently authenticated user.
tsstatic getName(): string;Returns
- Type:
string- Description: The user's name or identifier as a string.
isInRole()
Checks if the currently authenticated user is assigned to a specific security role.
tsstatic isInRole(role: string): boolean;
Parameter Type Description rolestringThe name of the role to check (e.g., 'Administrator', 'User'). Returns
- Type:
boolean- Description: True if the user is in the specified role, false otherwise.
getTimeout()
Retrieves the remaining session timeout for the current user session in seconds.
tsstatic getTimeout(): number;Returns
- Type:
number- Description: The session timeout duration in seconds.
getAuthType()
Retrieves the authentication mechanism used for the current session (e.g., 'BASIC', 'FORM').
tsstatic getAuthType(): string;Returns
- Type:
string- Description: The type of authentication used.
getSecurityToken()
Retrieves the security token associated with the current user session. This might be a session ID or an access token.
tsstatic getSecurityToken(): string;Returns
- Type:
string- Description: The security token as a string.
getInvocationCount()
Retrieves the number of requests (invocations) made by the current user during the lifecycle of the current session.
tsstatic getInvocationCount(): number;Returns
- Type:
number- Description: The total invocation count.
getLanguage()
Retrieves the preferred language setting (e.g., 'en', 'de', 'es') for the current user.
tsstatic getLanguage(): string;Returns
- Type:
string- Description: The user's preferred language code.
