public static boolean limitationsAllow(List<OtherPrivilegesLimitationType> limitations, QName itemName, AbstractWorkItemType workItem) { return limitationsAllow(limitations, itemName); // temporary solution; we do not use work items selectors yet } }
private static List<PrismReferenceValue> getPotentialAssigneesForUser(MidPointPrincipal principal, QName limitationItemName, RelationRegistry relationRegistry) { // As for relations, WorkItem.assigneeRef should contain only the default ones. QName defaultRelation = relationRegistry.getDefaultRelation(); List<PrismReferenceValue> rv = new ArrayList<>(); rv.add(ObjectTypeUtil.createObjectRef(principal.getOid(), ObjectTypes.USER).relation(defaultRelation).asReferenceValue()); for (DelegatorWithOtherPrivilegesLimitations delegator : principal.getDelegatorWithOtherPrivilegesLimitationsCollection()) { if (DeputyUtils.limitationsAllow(delegator.getLimitations(), limitationItemName)) { rv.add(ObjectTypeUtil.createObjectRef(delegator.getDelegator(), defaultRelation).asReferenceValue()); } } return rv; }
&& ObjectTypeUtil.containsOid(assignees, target.getTarget().getOid())) { List<OtherPrivilegesLimitationType> limitations = DeputyUtils.extractLimitations(target.getAssignmentPath()); if (workItem != null && DeputyUtils.limitationsAllow(limitations, privilegeLimitationItemName, workItem) || workItem == null && DeputyUtils.limitationsAllow(limitations, privilegeLimitationItemName)) { return true;