Utility class for assessing the authentication state or identity of the current actor

class CurrentUser

Methods summary

Return Type Method Name Description
bool isAuthenticatedUser() Whether the current actor is authenticated as a User
bool isAuthenticatedAdmin() Whether the current actor is authenticated as an Admin
bool isMasqueradingAdmin() Whether the current actor is authenticated as an Admin but is also acting on behalf of the client, having performed a "Login as Owner".
User|null user() Get the currently authenticated user.
Admin|null admin() Get the currently authenticated admin.
Client|null client() Get the currently active client for management.

Details

bool isAuthenticatedUser ()

Whether the current actor is authenticated as a User

Return Value

bool

bool isAuthenticatedAdmin ()

Whether the current actor is authenticated as an Admin

Return Value

bool

bool isMasqueradingAdmin ()

Whether the current actor is authenticated as an Admin but is also acting on behalf of the client, having performed a "Login as Owner".

Return Value

bool

User|null user ()

Get the currently authenticated user.

Return Value

User|null

Admin|null admin ()

Get the currently authenticated admin.

Return Value

Admin|null

Client|null client ()

Get the currently active client for management.

Return Value

Client|null