Package com.avoka.fc.core.util
Class RemoteUserProvider
java.lang.Object
com.avoka.fc.core.util.RemoteUserProvider
Provides information around the currently logged in user.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()Clear the thread local objects.static voidSet the thread settings in the RemoteUserProvider as defined in the parameter mapReturn permission set for the anonymous roleGets the client id set.static booleanGets the client restricted mode.static booleanGets the global access.Return the names of all permissions associated with the user and the portal the user is logged on tostatic StringReturn the portals's unique OIDReturn permission set for the portalstatic StringReturn the portals's typestatic StringReturn the user name (generally login name) of the remote userReturn permission set for the service user rolestatic UserAccountReturn the user's user account objectstatic StringReturn the user's unique OIDstatic booleanhasAccessClient(Long clientId) Checks if the RemoteUser is in Manager (clientRestrictionMode is true) has access to the client that is is a Global Admin or has access to the client.static voidInvalidate the cache.static voidsetClientIdSet(Set<Long> set) Sets the client id set.static voidsetClientRestrictionMode(boolean isClientRestrictedMode) Sets the client restricted mode.static voidsetGlobalAccess(boolean hasGlobalAccess) Sets the global access.static voidsetPermissionSet(Set<String> set) Set the names of all permissions associated with the user and the portal the user is logged on tostatic voidsetPortalId(String userId) Set the portal's unique OIDstatic voidsetPortalType(String portalType) Set the portal's typestatic voidsetRemoteUser(Object object) Set the login name of the remote userstatic voidsetUserAccount(UserAccount user) Set the user's user accountstatic voidSet the user's unique OIDtoMap()Return a map to characterise the thread settings in the RemoteUserProvider
-
Method Details
-
getUserId
Return the user's unique OID- Returns:
- the user's unique OID
-
setUserId
Set the user's unique OID- Parameters:
userId- the user's unique OID
-
setUserAccount
Set the user's user account- Parameters:
user- the user's user account object
-
getUserAccount
Return the user's user account object- Returns:
- the user account object
-
setPortalId
Set the portal's unique OID- Parameters:
userId- the user's unique OID- Since:
- 21.11.0
-
getPortalId
Return the portals's unique OID- Returns:
- the user's unique OID
- Since:
- 21.11.0
-
setPortalType
Set the portal's type- Parameters:
portalType- the portal type- Since:
- 21.11.0
-
getPortalType
Return the portals's type- Returns:
- the portal type
- Since:
- 21.11.0
-
setClientRestrictionMode
public static void setClientRestrictionMode(boolean isClientRestrictedMode) Sets the client restricted mode. Note this is only set by the RemoteUserFilter in Manager.- Parameters:
isClientRestrictedMode- the new global access- Since:
- 20.5.0
-
getClientRestrictionMode
public static boolean getClientRestrictionMode()Gets the client restricted mode. Note this is only set by the RemoteUserFilter in Manager.- Returns:
- the client restricted mode
- Since:
- 20.5.0
-
setGlobalAccess
public static void setGlobalAccess(boolean hasGlobalAccess) Sets the global access.- Parameters:
hasGlobalAccess- the new global access
-
getGlobalAccess
public static boolean getGlobalAccess()Gets the global access.- Returns:
- the global access
-
setClientIdSet
Sets the client id set.- Parameters:
set- the new client id set- Since:
- 4.0.0
-
getClientIdSet
Gets the client id set.- Returns:
- the client id set
- Since:
- 4.0.0
-
setPermissionSet
Set the names of all permissions associated with the user and the portal the user is logged on to- Parameters:
set- a set containing the permission names
-
getPermissionSet
Return the names of all permissions associated with the user and the portal the user is logged on to- Returns:
- the set of permission names, or an empty set if no permissions were set
-
setRemoteUser
Set the login name of the remote user- Parameters:
object- aUserAccountobject or String describing the remote user
-
getRemoteUser
Return the user name (generally login name) of the remote user- Returns:
- the user name
-
getAnonymousRolePermissions
Return permission set for the anonymous role- Returns:
- the set of permissions
-
getServiceRolePermissions
Return permission set for the service user role- Returns:
- the set of permissions
-
getPortalSupportedPermissions
Return permission set for the portal- Returns:
- the set of permissions
-
clear
public static void clear()Clear the thread local objects. -
hasAccessClient
Checks if the RemoteUser is in Manager (clientRestrictionMode is true) has access to the client that is is a Global Admin or has access to the client.- Parameters:
clientId- the Long id of the client to check- Returns:
- true if the RemoteUser is in Manager (clientRestrictionMode is true) has access to the client that is is a Global Admin or has access to the client.
- Since:
- 20.5.0
-
toMap
Return a map to characterise the thread settings in the RemoteUserProvider- Returns:
- Map of parameter names and values to represent the settings store in the RemoveUserProvider
- Since:
- 21.11.0
-
fromMap
Set the thread settings in the RemoteUserProvider as defined in the parameter map- Parameters:
params- Map of parameter names and values- Since:
- 21.11.0
-
permissionCacheInvalidate
public static void permissionCacheInvalidate()Invalidate the cache.
-