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 void
clear()
Clear the thread local objects.static void
Set the thread settings in the RemoteUserProvider as defined in the parameter mapReturn permission set for the anonymous roleGets the client id set.static boolean
Gets the client restricted mode.static boolean
Gets the global access.Return the names of all permissions associated with the user and the portal the user is logged on tostatic String
Return the portals's unique OIDReturn permission set for the portalstatic String
Return the portals's typestatic String
Return the user name (generally login name) of the remote userReturn permission set for the service user rolestatic UserAccount
Return the user's user account objectstatic String
Return the user's unique OIDstatic boolean
hasAccessClient
(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 void
Invalidate the cache.static void
setClientIdSet
(Set<Long> set) Sets the client id set.static void
setClientRestrictionMode
(boolean isClientRestrictedMode) Sets the client restricted mode.static void
setGlobalAccess
(boolean hasGlobalAccess) Sets the global access.static void
setPermissionSet
(Set<String> set) Set the names of all permissions associated with the user and the portal the user is logged on tostatic void
setPortalId
(String userId) Set the portal's unique OIDstatic void
setPortalType
(String portalType) Set the portal's typestatic void
setRemoteUser
(Object object) Set the login name of the remote userstatic void
setUserAccount
(UserAccount user) Set the user's user accountstatic void
Set 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
- aUserAccount
object 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.
-