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.

Show:
changeDepartment
(
  • newDept
)
Promise
public

Changes the department the user is currently viewing the department as.

Parameters:

  • newDept String

    new department to view

Returns:

Promise:

Promise that resolves when the request has been made successfully

changePassword
(
  • needSecure
)
private

Shortcut to trigger the change-password trigger

Parameters:

  • needSecure Boolean

    Whether or the user needs to change this password for security reasons.

check () Promise public

Checks if the user is still logged in.

Returns:

Promise:

Promise that resolves with the current user's status

checkDepartment
(
  • department
)
Boolean
public

Checks if the user is currently viewing the application as a particular department

Parameters:

  • department String

    department to check

Returns:

Boolean:

whether or not the current department matches the provided one

reload () Promise public

Reloads the user's roles

Returns:

Promise:

Promise that resolves when the request has completed.

apps

Array public

Array of apps the user has access to

currentDept

String public

Current department the user is viewing the application as

departments

Array public

Array of departments the user has access to for the current app

email

String public

Email of the user

hasRoles

Boolean public

If true, the user has roles in this app

hasRoles

Boolean public

If true, the user has at least one department

nameFirst

String public

First name of the user

nameFull

String public

Full name of the user, using the user's first, last, and preferred name (if available)

nameLast

String public

Last name of the user

namePref

String public

Preferred first name (nickname) of the user

roles

Array public

Array of roles the user has for the current app and department

userId

String public

Username of the logged in user.