Class ImpersonationAuthorizationService
- java.lang.Object
-
- com.netgrif.application.engine.impersonation.service.ImpersonationAuthorizationService
-
- All Implemented Interfaces:
IImpersonationAuthorizationService
@Service public class ImpersonationAuthorizationService extends java.lang.Object implements IImpersonationAuthorizationService
-
-
Field Summary
Fields Modifier and Type Field Description protected IAuthorityService
authorityService
protected IElasticCaseService
elasticCaseService
protected IProcessRoleService
processRoleService
protected ImpersonationProperties
properties
protected IUserService
userService
protected IWorkflowService
workflowService
-
Constructor Summary
Constructors Constructor Description ImpersonationAuthorizationService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canImpersonate(LoggedUser impersonator, java.lang.String configId)
boolean
canImpersonateUser(LoggedUser impersonator, java.lang.String userId)
protected java.lang.String
combineQueries(java.util.List<java.lang.String> queries)
protected java.util.Set<java.lang.String>
extractSetFromField(java.util.List<Case> cases, java.lang.String fieldId)
protected org.springframework.data.domain.Page<Case>
findCases(CaseSearchRequest request, org.springframework.data.domain.Pageable pageable)
java.util.List<Authority>
getAuthorities(java.util.List<Case> configs, IUser impersonated)
Case
getConfig(java.lang.String configId)
org.springframework.data.domain.Page<IUser>
getConfiguredImpersonationUsers(java.lang.String query, LoggedUser impersonator, org.springframework.data.domain.Pageable pageable)
java.lang.String
getImpersonatedUserId(Case config)
protected java.util.List<java.lang.String>
getMultichoiceValue(DataField field)
java.util.List<ProcessRole>
getRoles(java.util.List<Case> configs, IUser impersonated)
java.time.LocalDateTime
getValidUntil(Case config)
protected boolean
isValidAndContainsUser(Case config, java.lang.String id)
protected CaseSearchRequest
makeRequest(java.lang.String impersonatorId, java.lang.String impersonatedId)
protected java.time.LocalDateTime
parseTime(Case config, java.lang.String field)
java.util.List<Case>
searchConfigs(java.lang.String impersonatorId, java.lang.String impersonatedId)
org.springframework.data.domain.Page<Case>
searchConfigs(java.lang.String impersonatorId, org.springframework.data.domain.Pageable pageable)
protected boolean
validateTime(java.time.LocalDateTime first, java.time.LocalDateTime second)
protected java.util.List<java.lang.String>
validityQueries()
-
-
-
Field Detail
-
properties
@Autowired protected ImpersonationProperties properties
-
userService
@Autowired protected IUserService userService
-
elasticCaseService
@Autowired protected IElasticCaseService elasticCaseService
-
authorityService
@Autowired protected IAuthorityService authorityService
-
workflowService
@Autowired protected IWorkflowService workflowService
-
processRoleService
@Autowired protected IProcessRoleService processRoleService
-
-
Method Detail
-
getConfiguredImpersonationUsers
public org.springframework.data.domain.Page<IUser> getConfiguredImpersonationUsers(java.lang.String query, LoggedUser impersonator, org.springframework.data.domain.Pageable pageable)
- Specified by:
getConfiguredImpersonationUsers
in interfaceIImpersonationAuthorizationService
-
canImpersonate
public boolean canImpersonate(LoggedUser impersonator, java.lang.String configId)
- Specified by:
canImpersonate
in interfaceIImpersonationAuthorizationService
-
canImpersonateUser
public boolean canImpersonateUser(LoggedUser impersonator, java.lang.String userId)
- Specified by:
canImpersonateUser
in interfaceIImpersonationAuthorizationService
-
searchConfigs
public org.springframework.data.domain.Page<Case> searchConfigs(java.lang.String impersonatorId, org.springframework.data.domain.Pageable pageable)
- Specified by:
searchConfigs
in interfaceIImpersonationAuthorizationService
-
searchConfigs
public java.util.List<Case> searchConfigs(java.lang.String impersonatorId, java.lang.String impersonatedId)
- Specified by:
searchConfigs
in interfaceIImpersonationAuthorizationService
-
getAuthorities
public java.util.List<Authority> getAuthorities(java.util.List<Case> configs, IUser impersonated)
- Specified by:
getAuthorities
in interfaceIImpersonationAuthorizationService
-
getRoles
public java.util.List<ProcessRole> getRoles(java.util.List<Case> configs, IUser impersonated)
- Specified by:
getRoles
in interfaceIImpersonationAuthorizationService
-
getConfig
public Case getConfig(java.lang.String configId)
- Specified by:
getConfig
in interfaceIImpersonationAuthorizationService
-
getImpersonatedUserId
public java.lang.String getImpersonatedUserId(Case config)
- Specified by:
getImpersonatedUserId
in interfaceIImpersonationAuthorizationService
-
getValidUntil
public java.time.LocalDateTime getValidUntil(Case config)
- Specified by:
getValidUntil
in interfaceIImpersonationAuthorizationService
-
makeRequest
protected CaseSearchRequest makeRequest(java.lang.String impersonatorId, java.lang.String impersonatedId)
-
validityQueries
protected java.util.List<java.lang.String> validityQueries()
-
combineQueries
protected java.lang.String combineQueries(java.util.List<java.lang.String> queries)
-
findCases
protected org.springframework.data.domain.Page<Case> findCases(CaseSearchRequest request, org.springframework.data.domain.Pageable pageable)
-
isValidAndContainsUser
protected boolean isValidAndContainsUser(Case config, java.lang.String id)
-
validateTime
protected boolean validateTime(java.time.LocalDateTime first, java.time.LocalDateTime second)
-
extractSetFromField
protected java.util.Set<java.lang.String> extractSetFromField(java.util.List<Case> cases, java.lang.String fieldId)
-
getMultichoiceValue
protected java.util.List<java.lang.String> getMultichoiceValue(DataField field)
-
parseTime
protected java.time.LocalDateTime parseTime(Case config, java.lang.String field)
-
-