This service handles various functionality that deals with logged in user management. This is one of the most used services in Ember FW GC, and once injected has various properties and methods which can be called upon it which are invaluable to various aspects of the department.
Note: This is different from the user model in that this deals with the currently logged in user, rather than an array of user models from Group Control. Because this is a service and not a user model, it should not be used as such. For example, a property expecting a user model, should not be set in the following way:
this.set('user', this.get('currentUser'));
But rather using the id to find the actual user model from a user array:
this.set('user', this.get('users').findBy('id', this.get('currentUser.userId')));
That being said the CurrentUser service is indispensable to a proper integration of Group Control with the apps. For a list of all available properties and methods, see below.
-
newDept
Changes the department the user is currently viewing the department as.
Parameters:
-
newDept
Stringnew department to view
Returns:
Promise that resolves when the request has been made successfully
-
needSecure
Shortcut to trigger the change-password trigger
Parameters:
-
needSecure
BooleanWhether or the user needs to change this password for security reasons.
Checks if the user is still logged in.
Returns:
Promise that resolves with the current user's status
nameFull
String publicFull name of the user, using the user's first, last, and preferred name (if available)