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 IUserServiceuserService
-
Constructor Summary
Constructors Modifier Constructor Description protectedSecurityContextService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidforceReloadSecurityContext(LoggedUser loggedUser)Reloads the security context according to currently logged user from databasebooleanisAuthenticatedPrincipalLoggedUser()Checks type of SecurityContextvoidreloadSecurityContext(LoggedUser loggedUser)Reloads the security context according to currently logged uservoidsaveToken(java.lang.String token)Saves token to the cache if the state of context object was changed and needs to be updatedvoidsetUserService(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:
saveTokenin 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:
reloadSecurityContextin 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:
forceReloadSecurityContextin interfaceISecurityContextService- Parameters:
loggedUser- the user whose context needs to be reloaded
-
isAuthenticatedPrincipalLoggedUser
public boolean isAuthenticatedPrincipalLoggedUser()
Checks type of SecurityContext- Specified by:
isAuthenticatedPrincipalLoggedUserin interfaceISecurityContextService- Returns:
- true if the SecurityContext exists and is of type LoggedUser
-
setUserService
@Autowired @Lazy public void setUserService(IUserService userService)
-
-