Package de.xima.fc.user
Class VirtualUser
- java.lang.Object
-
- de.xima.fc.user.VirtualUser
-
- All Implemented Interfaces:
IUser
,Serializable
public class VirtualUser extends Object implements IUser
Model for virtual users such as the SYSTEM user.- Since:
- 8.0.0
- Author:
- XIMA Media GmbH
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VirtualUser.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VirtualUser.Builder
builder(UserProfile userProfile)
static VirtualUser.Builder
builder(IUser user)
static VirtualUser.Builder
builder(String refId)
boolean
equals(Object obj)
IAuthenticationContext
getAuthenticationContext()
Set<IClientAuthorization>
getClientAuthorizations()
Returns all client authorizations this user has been assigned.String
getDisplayName()
String
getEmail()
String
getFamilyName()
String
getFirstName()
EGender
getGender()
Set<String>
getPermissions()
URI
getPictureUrl()
UserProfile
getProfile()
Set<String>
getRoles()
String
getUniversalReferenceId()
String
getUserName()
int
hashCode()
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.xima.fc.interfaces.user.IUser
getAuthorizedClients, getClientAuthorizations, getClientInboxes, getClientUserGroups, getInboxes, getScopedUserGroups, getUserGroups, hasClientPermission, hasClientRole, hasGeneralPermission, hasSystemPermission, hasSystemRole
-
-
-
-
Method Detail
-
getUniversalReferenceId
public String getUniversalReferenceId()
- Specified by:
getUniversalReferenceId
in interfaceIUser
- Returns:
- the universal reference ID of this user. The universal reference ID is unique for every user within the
system across all authentication clients. See
UserMgmtUtils.getUniversalReferenceId(EHashAlgorithm, String, String)
for universal reference ID format.
-
getAuthenticationContext
public IAuthenticationContext getAuthenticationContext()
- Specified by:
getAuthenticationContext
in interfaceIUser
- Returns:
- the authentication context for this user. The authentication context contains information about how the user authenticated. Virtual users don't have an authentication context because they have never been authenticated.
-
getEmail
public String getEmail()
-
getUserName
public String getUserName()
- Specified by:
getUserName
in interfaceIUser
- Returns:
- the user name of this user within the formcycle system if there is any and
null
otherwise.
-
getFirstName
public String getFirstName()
- Specified by:
getFirstName
in interfaceIUser
- Returns:
- the first name of the user if there is any. The first name may come from the formcycle profile or the profile returned by the authentication client.
-
getFamilyName
public String getFamilyName()
- Specified by:
getFamilyName
in interfaceIUser
- Returns:
- the family name of the user if there is any. The family name may come from the formcycle profile or the profile returned by the authentication client.
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceIUser
- Returns:
- the display name of the user if there is any. The display name may come from the formcycle profile or the profile returned by the authentication client and is usually the full name (first and family name separated by whitespace).
-
getGender
public EGender getGender()
- Specified by:
getGender
in interfaceIUser
- Returns:
- the gender of the user if there is any specified and
EGender.UNSPECIFIED
otherwise. The gender may come from the formcycle profile or the profile returned by the authentication client.
-
getPictureUrl
public URI getPictureUrl()
- Specified by:
getPictureUrl
in interfaceIUser
- Returns:
- the picture URL of the user if there is any and
null
otherwise. The picture URL may come from the profile returned by the authentication client.
-
getProfile
public UserProfile getProfile()
- Specified by:
getProfile
in interfaceIUser
- Returns:
- the formcycle profile of the user if a match was found in the system and
null
otherwise.
-
getRoles
public Set<String> getRoles()
- Specified by:
getRoles
in interfaceIUser
- Returns:
- A
Set
of roles of the user within the system. Roles are scoped to clients or the system. For the format of client roles seeUserMgmtUtils.getClientRole(Mandant, String)
. The format of system roles is just the role name.
-
getPermissions
public Set<String> getPermissions()
- Specified by:
getPermissions
in interfaceIUser
- Returns:
- A
Set
of permission the user has within the system. Permissions are scoped to clients or the system. For the format of client permissions seeUserMgmtUtils.getClientPermission(Mandant, String)
. The format of system permissions is just the permission name.
-
getClientAuthorizations
public Set<IClientAuthorization> getClientAuthorizations()
Description copied from interface:IUser
Returns all client authorizations this user has been assigned. Client authorizations may be direct through a FOMRCYCLE account (seeDirectClientAuthorization.getUserProfile()
) or in indirect through filters (seeIndirectClientAuthorization
). The super user has authorizations to all clients that have super user access enabled (seeMandant.isSadminAccess()
).- Specified by:
getClientAuthorizations
in interfaceIUser
- Returns:
- a set of all authorizations for this user within the given client.
-
builder
public static VirtualUser.Builder builder(String refId)
-
builder
public static VirtualUser.Builder builder(UserProfile userProfile)
-
builder
public static VirtualUser.Builder builder(IUser user)
-
-