Frontend | Backend | Api

Current User (Api)

Helper for accessing information about the currently authenticated user. Can be accessed with $_currentUser

Property Description Returns
id Return the id of the currently authenticated user. Returns null if no user is authenticated. int
globalId Return the global id for the user, if the user has a global user int
personId Return the person id for the user, if the user is logged in int
loggedIn Check whether a user is logged in bool
admin Check whether the logged in user is an admin for the current site. Will also return true if the user is a superadmin or developer. bool
superAdmin Check whether the logged in user is a superadmin. Superadmins are allowed full access to all sites in a client's database. Will also return true if the user is a developer. bool
developer Check whether the logged in user is a developer. Developers are allowed full access to everything and can switch sites. bool
frontendUser Check whether the logged in user is a frontend user bool
backendUser Check whether the logged in user is a backend user bool
type Get the user type for the logged in user. Returns 'frontend' if the user is not logged in. string
fullName Get the current user's full name. Returns an empty string if no user is logged in. string