Current User
Updated on Aug 8, 2023 2 minutes to readTo utilize the methods offered by this plugin, you should call them through the E8App.$currentUser object.
Get user avatar URL
Syntax:
E8App.$currentUser.getAvatarUrl()
Description:
Gets the user profile picture URL.
Returned value:
URL of the user account image.
Type: String
E8App.$currentUser.getAvatarURL();
Get user account email address
Syntax:
E8App.$currentUser.getEmail()
Description:
Gets a user account email address.
Returned value:
Email address.
Type: String
E8App.$currentUser.getEmail();
Get user account Id
Syntax:
E8App.$currentUser.getId()
Description:
Gets the user account Id.
Returned value:
User account Id.
Type: Number
E8App.$currentUser.getId();
Get user account identity
Syntax:
E8App.$currentUser.getIdentity()
Description:
Gets MD5 hash converted from the user account email address.
Returned value:
Alphanumeric key.
Type: String
E8App.$currentUser.getIdentity();
Get user account presentation
Syntax:
E8App.$currentUser.getPresentation()
Description:
Gets the first and last name of a user if the corresponding fields in the account are filled in, otherwise – username.
Returned value:
The first and last name (or username).
Type: String
E8App.$currentUser.getPresentation();
Get username
Syntax:
E8App.$currentUser.getUsername()
Description:
Gets username (default username - email address).
Returned value:
The Username.
Type: String
E8App.$currentUser.getUsername();
Checking user account role
Syntax:
E8App.$currentUser.isInRole(<role>)
Description:
Checks if a specified role is assigned to a user account.
Parameters:
<role> - required
Type: String
The script alias of a role.
Returned value:
The promise resolves to the Boolean value representing the response to your request.
Type: Object
E8App.$currentUser.isInRole('rolFullRights');