Class AdminUser
- All Implemented Interfaces:
Serializable
AdminRoles
and
AdminPermissions
.
This domain is synchronized to the authentication service through messaging on each persistence event.
- Author:
- Samarth Dhruva (samarthd)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The ids of applications this user is a member of.Used to expose this entity's mutability in a request context.The ids of applications this user is a member of.The default communication preference of the user.The default time zone for this user.getEmail()
The email address of the user.Get this AdminUser's roles that were assigned by a third party authorization provider.getId()
The unique identifier for this user.getName()
The name of this user.The permissions that this user is directly assigned (in addition to permissions granted throughroles
).getPhone()
The phone number of the user.The permissions that this user is directly assigned that are restricted to only apply when accessing certain segments of data.Gets theAdminPermissionRef
fromrestrictedPermissions
.The roles that this user is directly assigned that are restricted to only apply when accessing certain segments of data.Gets theAdminRoleRef
fromrestrictedRoles
.The data restrictions that control the data this user is permitted to access.getRoles()
The roles that this user is assigned.The id of the tenant this user is associated with.The username of this user, used to log into the application.int
hashCode()
boolean
isActive()
A flag indicating whether the admin user account is enabled.boolean
Indicates whether this user has access at the application level or not.boolean
A flag indicating whether the admin user account requires a password reset.boolean
A flag indicating whether the admin user account is expired.boolean
isGlobal()
If true, this user is a global user, meaning that they can access the global applications.boolean
A flag indicating whether the admin user account can grant any authority.boolean
isLocked()
A flag indicating whether the admin user account is locked due to too many failed login attempts.boolean
Indicates whether this user has access at the tenant level or not.boolean
Deprecated.void
setActive
(boolean active) A flag indicating whether the admin user account is enabled.void
setApplicationAccess
(boolean applicationAccess) Indicates whether this user has access at the application level or not.void
setApplicationIds
(Set<String> applicationIds) The ids of applications this user is a member of.void
setChangePasswordRequired
(boolean changePasswordRequired) A flag indicating whether the admin user account requires a password reset.void
setContextState
(MutabilityContextState contextState) Used to expose this entity's mutability in a request context.void
setDefaultApplicationId
(String defaultApplicationId) The ids of applications this user is a member of.void
setDefaultCommunicationPreference
(String defaultCommunicationPreference) The default communication preference of the user.void
setDefaultTimeZone
(String defaultTimeZone) The default time zone for this user.void
The email address of the user.void
setExpired
(boolean expired) A flag indicating whether the admin user account is expired.void
setGlobal
(boolean global) If true, this user is a global user, meaning that they can access the global applications.void
setGrantAnyAuthorityAllowed
(boolean grantAnyAuthorityAllowed) A flag indicating whether the admin user account can grant any authority.void
The unique identifier for this user.void
setLocked
(boolean locked) A flag indicating whether the admin user account is locked due to too many failed login attempts.void
The name of this user.void
setPermissions
(Set<AdminPermissionRef> permissions) The permissions that this user is directly assigned (in addition to permissions granted throughroles
).void
The phone number of the user.void
setRestrictedPermissions
(Set<AdminRestrictedPermission> restrictedPermissions) The permissions that this user is directly assigned that are restricted to only apply when accessing certain segments of data.void
setRestrictedRoles
(Set<AdminRestrictedRole> restrictedRoles) The roles that this user is directly assigned that are restricted to only apply when accessing certain segments of data.void
setRestrictions
(Set<AdminRestriction> restrictions) The data restrictions that control the data this user is permitted to access.void
setRoles
(Set<AdminRoleRef> roles) The roles that this user is assigned.void
setTenantAccess
(boolean tenantAccess) Indicates whether this user has access at the tenant level or not.void
setTenantId
(String tenantId) The id of the tenant this user is associated with.void
setTenantUser
(boolean tenantUser) Deprecated.in favor oftenantAccess
void
setUsername
(String username) The username of this user, used to log into the application.toString()
-
Constructor Details
-
AdminUser
public AdminUser()
-
-
Method Details
-
getRestrictedPermissionsPermissionRefs
Gets theAdminPermissionRef
fromrestrictedPermissions
.- Returns:
- Set of permissions
-
getRestrictedRolesRoleRefs
Gets theAdminRoleRef
fromrestrictedRoles
.- Returns:
- Set of roles
-
getExternalRoleNames
Get this AdminUser's roles that were assigned by a third party authorization provider. Note, this will only be accurate if the system has hydrated the roles.- Returns:
- Set of this AdminUser's roles that were assigned by a third party authorization provider.
- See Also:
-
roles
-
getId
The unique identifier for this user. -
getName
The name of this user. -
getUsername
The username of this user, used to log into the application. May be the same asemail
, but that is not necessary. -
getEmail
The email address of the user. -
getPhone
The phone number of the user. -
getDefaultCommunicationPreference
The default communication preference of the user. -
isGlobal
public boolean isGlobal()If true, this user is a global user, meaning that they can access the global applications. If not, the user can only access the applications they are assigned to viaapplicationIds
.- Returns:
- true if the user is a global user which can access global applications, false if the user can only access applications they are assigned to
-
isActive
public boolean isActive()A flag indicating whether the admin user account is enabled. If false, they will not be able to log in.This flag should be used if the admin user needs to be enabled/disabled for administrative reasons.
- Returns:
- true if the admin user account is enabled, false otherwise
-
isLocked
public boolean isLocked()A flag indicating whether the admin user account is locked due to too many failed login attempts.- Returns:
- true if the admin user account is locked, false otherwise
-
isExpired
public boolean isExpired()A flag indicating whether the admin user account is expired. If false, they will not be able to log in.This flag can be used to declare an account as expired and unusable, but currently there is no logic for that. It will always be
false
.- Returns:
- true if the admin user account is expired, false otherwise
-
isChangePasswordRequired
public boolean isChangePasswordRequired()A flag indicating whether the admin user account requires a password reset. If true, they will not be able to log in until they reset their password.- Returns:
- true if the admin user's password is expired and requires a reset, false otherwise
-
isGrantAnyAuthorityAllowed
public boolean isGrantAnyAuthorityAllowed()A flag indicating whether the admin user account can grant any authority. If true, this user can grant any roles or permissions to any users without needing to have those permissions itself. If false, it can only grant authorities that the user itself has, either permissions that aredirectly assigned
or inherited fromroles
within the specifiedrestrictions
, or permissions within their own specified restrictions fromrestrictedRoles
orrestrictedPermissions
.- Returns:
- true if the admin user can grant any authority, false if the user can only grant authority that the user itself has
-
getRoles
The roles that this user is assigned. The user is granted all permissions that each of these roles are directly assigned or inherit from their ancestors.These can only be roles whose
AdminRole.tenantId
is accessible from this user'stenantId
.- See Also:
-
getPermissions
The permissions that this user is directly assigned (in addition to permissions granted throughroles
).These can only be permissions whose
AdminPermission.tenantId
is accessible from this user'stenantId
. -
getRestrictions
The data restrictions that control the data this user is permitted to access. -
getRestrictedRoles
The roles that this user is directly assigned that are restricted to only apply when accessing certain segments of data. -
getRestrictedPermissions
The permissions that this user is directly assigned that are restricted to only apply when accessing certain segments of data. -
getApplicationIds
The ids of applications this user is a member of. -
getDefaultApplicationId
The ids of applications this user is a member of. -
getTenantId
The id of the tenant this user is associated with. -
isTenantUser
Deprecated.in favor oftenantAccess
Indicates whether this is a tenant level user or not.- Returns:
- Is this a tenant level user?
-
isTenantAccess
public boolean isTenantAccess()Indicates whether this user has access at the tenant level or not.- Returns:
- Does this user have tenant level access?
-
isApplicationAccess
public boolean isApplicationAccess()Indicates whether this user has access at the application level or not.- Returns:
- Does this user have application level access?
-
getDefaultTimeZone
The default time zone for this user. It will be used to format the dates in the Admin panel if specified.- Returns:
- The default time zone for this user
-
getContextState
Used to expose this entity's mutability in a request context.For example, can be used to hint to the admin application to show this entity as read-only.
- See Also:
-
setId
The unique identifier for this user. -
setName
The name of this user. -
setUsername
The username of this user, used to log into the application. May be the same asemail
, but that is not necessary. -
setEmail
The email address of the user. -
setPhone
The phone number of the user. -
setDefaultCommunicationPreference
The default communication preference of the user. -
setGlobal
public void setGlobal(boolean global) If true, this user is a global user, meaning that they can access the global applications. If not, the user can only access the applications they are assigned to viaapplicationIds
.- Parameters:
global
- true if the user is a global user which can access global applications, false if the user can only access applications they are assigned to
-
setActive
public void setActive(boolean active) A flag indicating whether the admin user account is enabled. If false, they will not be able to log in.This flag should be used if the admin user needs to be enabled/disabled for administrative reasons.
- Parameters:
active
- true if the admin user account is enabled, false otherwise
-
setLocked
public void setLocked(boolean locked) A flag indicating whether the admin user account is locked due to too many failed login attempts.- Parameters:
locked
- true if the admin user account is locked, false otherwise
-
setExpired
public void setExpired(boolean expired) A flag indicating whether the admin user account is expired. If false, they will not be able to log in.This flag can be used to declare an account as expired and unusable, but currently there is no logic for that. It will always be
false
.- Parameters:
expired
- true if the admin user account is expired, false otherwise
-
setChangePasswordRequired
public void setChangePasswordRequired(boolean changePasswordRequired) A flag indicating whether the admin user account requires a password reset. If true, they will not be able to log in until they reset their password.- Parameters:
changePasswordRequired
- true if the admin user's password is expired and requires a reset, false otherwise
-
setGrantAnyAuthorityAllowed
public void setGrantAnyAuthorityAllowed(boolean grantAnyAuthorityAllowed) A flag indicating whether the admin user account can grant any authority. If true, this user can grant any roles or permissions to any users without needing to have those permissions itself. If false, it can only grant authorities that the user itself has, either permissions that aredirectly assigned
or inherited fromroles
within the specifiedrestrictions
, or permissions within their own specified restrictions fromrestrictedRoles
orrestrictedPermissions
.- Parameters:
grantAnyAuthorityAllowed
- true if the admin user can grant any authority, false if the user can only grant authority that the user itself has
-
setRoles
The roles that this user is assigned. The user is granted all permissions that each of these roles are directly assigned or inherit from their ancestors.These can only be roles whose
AdminRole.tenantId
is accessible from this user'stenantId
.- See Also:
-
setPermissions
The permissions that this user is directly assigned (in addition to permissions granted throughroles
).These can only be permissions whose
AdminPermission.tenantId
is accessible from this user'stenantId
. -
setRestrictions
The data restrictions that control the data this user is permitted to access. -
setRestrictedRoles
The roles that this user is directly assigned that are restricted to only apply when accessing certain segments of data. -
setRestrictedPermissions
The permissions that this user is directly assigned that are restricted to only apply when accessing certain segments of data. -
setApplicationIds
The ids of applications this user is a member of. -
setDefaultApplicationId
The ids of applications this user is a member of. -
setTenantId
The id of the tenant this user is associated with. -
setTenantUser
Deprecated.in favor oftenantAccess
Indicates whether this is a tenant level user or not.- Parameters:
tenantUser
- Is this a tenant level user?
-
setTenantAccess
public void setTenantAccess(boolean tenantAccess) Indicates whether this user has access at the tenant level or not.- Parameters:
tenantAccess
- Does this user have tenant level access?
-
setApplicationAccess
public void setApplicationAccess(boolean applicationAccess) Indicates whether this user has access at the application level or not.- Parameters:
applicationAccess
- Does this user have application level access?
-
setDefaultTimeZone
The default time zone for this user. It will be used to format the dates in the Admin panel if specified.- Parameters:
defaultTimeZone
- The default time zone for this user
-
setContextState
Used to expose this entity's mutability in a request context.For example, can be used to hint to the admin application to show this entity as read-only.
- See Also:
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-
tenantAccess