Class SecurityContextService
- java.lang.Object
-
- com.netgrif.application.engine.security.service.SecurityContextService
-
- All Implemented Interfaces:
ISecurityContextService
@Service public class SecurityContextService extends java.lang.Object implements ISecurityContextService
Service for managing security context object, like user resource
-
-
Field Summary
Fields Modifier and Type Field Description protected IUserService
userService
-
Constructor Summary
Constructors Modifier Constructor Description protected
SecurityContextService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forceReloadSecurityContext(LoggedUser loggedUser)
Reloads the security context according to currently logged user from databaseboolean
isAuthenticatedPrincipalLoggedUser()
Checks type of SecurityContextvoid
reloadSecurityContext(LoggedUser loggedUser)
Reloads the security context according to currently logged uservoid
saveToken(java.lang.String token)
Saves token to the cache if the state of context object was changed and needs to be updatedvoid
setUserService(IUserService userService)
-
-
-
Field Detail
-
userService
protected IUserService userService
-
-
Method Detail
-
saveToken
public void saveToken(java.lang.String token)
Saves token to the cache if the state of context object was changed and needs to be updated- Specified by:
saveToken
in interfaceISecurityContextService
- Parameters:
token
- the token string to be cached
-
reloadSecurityContext
public void reloadSecurityContext(LoggedUser loggedUser)
Reloads the security context according to currently logged user- Specified by:
reloadSecurityContext
in interfaceISecurityContextService
- Parameters:
loggedUser
- the user whose context needs to be reloaded
-
forceReloadSecurityContext
public void forceReloadSecurityContext(LoggedUser loggedUser)
Reloads the security context according to currently logged user from database- Specified by:
forceReloadSecurityContext
in interfaceISecurityContextService
- Parameters:
loggedUser
- the user whose context needs to be reloaded
-
isAuthenticatedPrincipalLoggedUser
public boolean isAuthenticatedPrincipalLoggedUser()
Checks type of SecurityContext- Specified by:
isAuthenticatedPrincipalLoggedUser
in interfaceISecurityContextService
- Returns:
- true if the SecurityContext exists and is of type LoggedUser
-
setUserService
@Autowired @Lazy public void setUserService(IUserService userService)
-
-