Package com.avoka.fc.core.util
Class RemoteUserProvider
- java.lang.Object
-
- com.avoka.fc.core.util.RemoteUserProvider
-
public class RemoteUserProvider extends Object
Provides information around the currently logged in user.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclear()Clear the thread local objects.static voidfromMap(Map<String,Object> params)Set the thread settings in the RemoteUserProvider as defined in the parameter mapstatic Set<String>getAnonymousRolePermissions()Return permission set for the anonymous rolestatic Set<Long>getClientIdSet()Gets the client id set.static booleangetClientRestrictionMode()Gets the client restricted mode.static booleangetGlobalAccess()Gets the global access.static Set<String>getPermissionSet()Return the names of all permissions associated with the user and the portal the user is logged on tostatic StringgetPortalId()Return the portals's unique OIDstatic Set<String>getPortalSupportedPermissions()Return permission set for the portalstatic StringgetPortalType()Return the portals's typestatic StringgetRemoteUser()Return the user name (generally login name) of the remote userstatic Set<String>getServiceRolePermissions()Return permission set for the service user rolestatic UserAccountgetUserAccount()Return the user's user account objectstatic StringgetUserId()Return 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 voidpermissionCacheInvalidate()Invalidate 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 voidsetUserId(String userId)Set the user's unique OIDstatic Map<String,Object>toMap()Return a map to characterise the thread settings in the RemoteUserProvider
-
-
-
Method Detail
-
getUserId
public static String getUserId()
Return the user's unique OID- Returns:
- the user's unique OID
-
setUserId
public static void setUserId(String userId)
Set the user's unique OID- Parameters:
userId- the user's unique OID
-
setUserAccount
public static void setUserAccount(UserAccount user)
Set the user's user account- Parameters:
user- the user's user account object
-
getUserAccount
public static UserAccount getUserAccount()
Return the user's user account object- Returns:
- the user account object
-
setPortalId
public static void setPortalId(String userId)
Set the portal's unique OID- Parameters:
userId- the user's unique OID- Since:
- 21.11.0
-
getPortalId
public static String getPortalId()
Return the portals's unique OID- Returns:
- the user's unique OID
- Since:
- 21.11.0
-
setPortalType
public static void setPortalType(String portalType)
Set the portal's type- Parameters:
portalType- the portal type- Since:
- 21.11.0
-
getPortalType
public static String 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
public static void setClientIdSet(Set<Long> set)
Sets the client id set.- Parameters:
set- the new client id set- Since:
- 4.0.0
-
getClientIdSet
public static Set<Long> getClientIdSet()
Gets the client id set.- Returns:
- the client id set
- Since:
- 4.0.0
-
setPermissionSet
public static void setPermissionSet(Set<String> set)
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
public static Set<String> 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
public static void setRemoteUser(Object object)
Set the login name of the remote user- Parameters:
object- aUserAccountobject or String describing the remote user
-
getRemoteUser
public static String getRemoteUser()
Return the user name (generally login name) of the remote user- Returns:
- the user name
-
getAnonymousRolePermissions
public static Set<String> getAnonymousRolePermissions()
Return permission set for the anonymous role- Returns:
- the set of permissions
-
getServiceRolePermissions
public static Set<String> getServiceRolePermissions()
Return permission set for the service user role- Returns:
- the set of permissions
-
getPortalSupportedPermissions
public static Set<String> getPortalSupportedPermissions()
Return permission set for the portal- Returns:
- the set of permissions
-
clear
public static void clear()
Clear the thread local objects.
-
hasAccessClient
public static 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.- 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
public static Map<String,Object> 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
public static void fromMap(Map<String,Object> params)
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.
-
-