Class OrgStructFunctionsImpl
- java.lang.Object
-
- com.evolveum.midpoint.model.impl.expr.OrgStructFunctionsImpl
-
- All Implemented Interfaces:
OrgStructFunctions
@Component public class OrgStructFunctionsImpl extends Object implements OrgStructFunctions
-
-
Constructor Summary
Constructors Constructor Description OrgStructFunctionsImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<UserType>
getManagers(UserType user, boolean preAuthorized)
Collection<UserType>
getManagers(UserType user, String orgType, boolean allowSelf, boolean preAuthorized)
Collection<UserType>
getManagersByOrgType(UserType user, String orgType, boolean preAuthorized)
Collection<UserType>
getManagersOfOrg(String orgOid, boolean preAuthorized)
Collection<String>
getManagersOids(UserType user, boolean preAuthorized)
Returns a list of user's managers.Collection<String>
getManagersOidsExceptUser(@NotNull Collection<ObjectReferenceType> userRefList, boolean preAuthorized)
Collection<String>
getManagersOidsExceptUser(UserType user, boolean preAuthorized)
<T extends ObjectType>
TgetObject(Class<T> type, String oid, boolean preAuthorized)
OrgType
getOrgByName(String name, boolean preAuthorized)
OrgType
getOrgByOid(String oid, boolean preAuthorized)
Collection<String>
getOrgUnits(UserType user, boolean preAuthorized)
Collection<String>
getOrgUnits(UserType user, QName relation, boolean preAuthorized)
OrgType
getParentOrgByArchetype(ObjectType object, String archetypeOid, boolean preAuthorized)
OrgType
getParentOrgByOrgType(ObjectType object, String orgType, boolean preAuthorized)
Collection<OrgType>
getParentOrgs(ObjectType object, boolean preAuthorized)
Collection<OrgType>
getParentOrgs(ObjectType object, String relation, String orgType, boolean preAuthorized)
Collection<OrgType>
getParentOrgs(ObjectType object, QName relation, @NotNull Predicate<OrgType> predicate, boolean preAuthorized)
Collection<OrgType>
getParentOrgs(ObjectType object, QName relation, String orgType, boolean preAuthorized)
Collection<OrgType>
getParentOrgsByRelation(ObjectType object, String relation, boolean preAuthorized)
Collection<OrgType>
getParentOrgsByRelation(ObjectType object, QName relation, boolean preAuthorized)
boolean
isManager(UserType user)
boolean
isManagerOf(UserType user, String orgOid, boolean preAuthorized)
boolean
isManagerOfOrgType(UserType user, String orgType, boolean preAuthorized)
-
-
-
Method Detail
-
getManagersOids
public Collection<String> getManagersOids(UserType user, boolean preAuthorized) throws SchemaException, SecurityViolationException
Returns a list of user's managers. Formally, for each Org O which this user has (any) relation to, all managers of O are added to the result. Some customizations are probably necessary here, e.g. filter out project managers (keep only line managers), or defining who is a manager of a user who is itself a manager in its org.unit. (A parent org unit manager, perhaps.)- Specified by:
getManagersOids
in interfaceOrgStructFunctions
- Returns:
- list of oids of the respective managers
- Throws:
SchemaException
SecurityViolationException
-
getManagersOidsExceptUser
public Collection<String> getManagersOidsExceptUser(UserType user, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getManagersOidsExceptUser
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
getManagersOidsExceptUser
public Collection<String> getManagersOidsExceptUser(@NotNull @NotNull Collection<ObjectReferenceType> userRefList, boolean preAuthorized) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException, ExpressionEvaluationException
-
getManagers
public Collection<UserType> getManagers(UserType user, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getManagers
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
getManagersByOrgType
public Collection<UserType> getManagersByOrgType(UserType user, String orgType, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getManagersByOrgType
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
getManagers
public Collection<UserType> getManagers(UserType user, String orgType, boolean allowSelf, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getManagers
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
getOrgUnits
public Collection<String> getOrgUnits(UserType user, boolean preAuthorized)
- Specified by:
getOrgUnits
in interfaceOrgStructFunctions
-
getOrgUnits
public Collection<String> getOrgUnits(UserType user, QName relation, boolean preAuthorized)
- Specified by:
getOrgUnits
in interfaceOrgStructFunctions
-
getOrgByOid
public OrgType getOrgByOid(String oid, boolean preAuthorized) throws SchemaException
- Specified by:
getOrgByOid
in interfaceOrgStructFunctions
- Throws:
SchemaException
-
getOrgByName
public OrgType getOrgByName(String name, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getOrgByName
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
getParentOrgByOrgType
public OrgType getParentOrgByOrgType(ObjectType object, String orgType, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgByOrgType
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
getParentOrgByArchetype
public OrgType getParentOrgByArchetype(ObjectType object, String archetypeOid, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgByArchetype
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
getParentOrgsByRelation
public Collection<OrgType> getParentOrgsByRelation(ObjectType object, QName relation, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgsByRelation
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
getParentOrgsByRelation
public Collection<OrgType> getParentOrgsByRelation(ObjectType object, String relation, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgsByRelation
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
getParentOrgs
public Collection<OrgType> getParentOrgs(ObjectType object, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgs
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
getParentOrgs
public Collection<OrgType> getParentOrgs(ObjectType object, String relation, String orgType, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgs
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
getParentOrgs
public Collection<OrgType> getParentOrgs(ObjectType object, QName relation, String orgType, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgs
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
getParentOrgs
public Collection<OrgType> getParentOrgs(ObjectType object, QName relation, @NotNull @NotNull Predicate<OrgType> predicate, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgs
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
getManagersOfOrg
public Collection<UserType> getManagersOfOrg(String orgOid, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getManagersOfOrg
in interfaceOrgStructFunctions
- Throws:
SchemaException
SecurityViolationException
-
isManagerOf
public boolean isManagerOf(UserType user, String orgOid, boolean preAuthorized)
- Specified by:
isManagerOf
in interfaceOrgStructFunctions
-
isManager
public boolean isManager(UserType user)
- Specified by:
isManager
in interfaceOrgStructFunctions
-
isManagerOfOrgType
public boolean isManagerOfOrgType(UserType user, String orgType, boolean preAuthorized) throws SchemaException
- Specified by:
isManagerOfOrgType
in interfaceOrgStructFunctions
- Throws:
SchemaException
-
getObject
public <T extends ObjectType> T getObject(Class<T> type, String oid, boolean preAuthorized) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException
-
-