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)OrgTypegetOrgByName(String name, boolean preAuthorized)OrgTypegetOrgByOid(String oid, boolean preAuthorized)Collection<String>getOrgUnits(UserType user, boolean preAuthorized)Collection<String>getOrgUnits(UserType user, QName relation, boolean preAuthorized)OrgTypegetParentOrgByArchetype(ObjectType object, String archetypeOid, boolean preAuthorized)OrgTypegetParentOrgByOrgType(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)booleanisManager(UserType user)booleanisManagerOf(UserType user, String orgOid, boolean preAuthorized)booleanisManagerOfOrgType(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:
getManagersOidsin interfaceOrgStructFunctions- Returns:
- list of oids of the respective managers
- Throws:
SchemaExceptionSecurityViolationException
-
getManagersOidsExceptUser
public Collection<String> getManagersOidsExceptUser(UserType user, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getManagersOidsExceptUserin interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
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:
getManagersin interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
getManagersByOrgType
public Collection<UserType> getManagersByOrgType(UserType user, String orgType, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getManagersByOrgTypein interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
getManagers
public Collection<UserType> getManagers(UserType user, String orgType, boolean allowSelf, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getManagersin interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
getOrgUnits
public Collection<String> getOrgUnits(UserType user, boolean preAuthorized)
- Specified by:
getOrgUnitsin interfaceOrgStructFunctions
-
getOrgUnits
public Collection<String> getOrgUnits(UserType user, QName relation, boolean preAuthorized)
- Specified by:
getOrgUnitsin interfaceOrgStructFunctions
-
getOrgByOid
public OrgType getOrgByOid(String oid, boolean preAuthorized) throws SchemaException
- Specified by:
getOrgByOidin interfaceOrgStructFunctions- Throws:
SchemaException
-
getOrgByName
public OrgType getOrgByName(String name, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getOrgByNamein interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
getParentOrgByOrgType
public OrgType getParentOrgByOrgType(ObjectType object, String orgType, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgByOrgTypein interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
getParentOrgByArchetype
public OrgType getParentOrgByArchetype(ObjectType object, String archetypeOid, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgByArchetypein interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
getParentOrgsByRelation
public Collection<OrgType> getParentOrgsByRelation(ObjectType object, QName relation, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgsByRelationin interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
getParentOrgsByRelation
public Collection<OrgType> getParentOrgsByRelation(ObjectType object, String relation, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgsByRelationin interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
getParentOrgs
public Collection<OrgType> getParentOrgs(ObjectType object, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgsin interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
getParentOrgs
public Collection<OrgType> getParentOrgs(ObjectType object, String relation, String orgType, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgsin interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
getParentOrgs
public Collection<OrgType> getParentOrgs(ObjectType object, QName relation, String orgType, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgsin interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
getParentOrgs
public Collection<OrgType> getParentOrgs(ObjectType object, QName relation, @NotNull @NotNull Predicate<OrgType> predicate, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getParentOrgsin interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
getManagersOfOrg
public Collection<UserType> getManagersOfOrg(String orgOid, boolean preAuthorized) throws SchemaException, SecurityViolationException
- Specified by:
getManagersOfOrgin interfaceOrgStructFunctions- Throws:
SchemaExceptionSecurityViolationException
-
isManagerOf
public boolean isManagerOf(UserType user, String orgOid, boolean preAuthorized)
- Specified by:
isManagerOfin interfaceOrgStructFunctions
-
isManager
public boolean isManager(UserType user)
- Specified by:
isManagerin interfaceOrgStructFunctions
-
isManagerOfOrgType
public boolean isManagerOfOrgType(UserType user, String orgType, boolean preAuthorized) throws SchemaException
- Specified by:
isManagerOfOrgTypein interfaceOrgStructFunctions- Throws:
SchemaException
-
getObject
public <T extends ObjectType> T getObject(Class<T> type, String oid, boolean preAuthorized) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException
-
-