User
User class handles the authenticated user
Returns: Object
| Object
- User details
hasPermission(permission) ⇒ Boolean
Boolean
Check if current user has a specific access permission
Available permissions are (more permissions may come in the future as the need for granularity grows):
Returns: Boolean
- exists
Parameters
Example
hasUserPermission() ⇒ boolean
boolean
Convinience method to find out if current user is a "user"
Returns: boolean
- If user is "user"
Example
hasPowerUserPermission() ⇒ boolean
boolean
Convinience method to find out if current user is a "power user"
Returns: boolean
- If user is "power user"
Example
hasAdminPermission() ⇒ boolean
boolean
Convinience method to find out if current user is an "admin user"
Returns: boolean
- If user is "admin"
Example
getUserInfo() ></code>
Get current logged in user info object. Object contains info about current user, organisation, selected unit and permissions
Returns: Promise.<{given_name:String, family_name:String, email:String, picture:String, org:String, unit: String, permissions: Array}>
- User details
logout() ⇒ void
void
Logout current user and reload page to trigger new login flow
Last updated