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
permission
String
Required - Permission to look for in users permissions
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()⇒ Promise.<{given_name:String, family_name:String, email:String, picture:String, org:String, unit: String, permissions: Array.<string>}>
Promise.<{given_name:String, family_name:String, email:String, picture:String, org:String, unit: String, permissions: Array.<string>}>
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.<string>}>
- User details
logout()⇒ void
void
Logout current user and reload page to trigger new login flow