/** * Create an instance of {@link SubjectedObjectSelectorType } * */ public SubjectedObjectSelectorType createSubjectedObjectSelectorType() { return new SubjectedObjectSelectorType(); }
private boolean isSelf(SubjectedObjectSelectorType spec) throws SchemaException { List<SpecialObjectSpecificationType> specSpecial = spec.getSpecial(); if (specSpecial != null && !specSpecial.isEmpty()) { if (spec.getFilter() != null || spec.getOrgRef() != null || spec.getOrgRelation() != null || spec.getRoleRelation() != null) { return false; } for (SpecialObjectSpecificationType special: specSpecial) { if (special == SpecialObjectSpecificationType.SELF) { return true; } else { throw new SchemaException("Unsupported special object specification specified in authorization: "+special); } } } return false; }
public SubjectedObjectSelectorType clone() { SubjectedObjectSelectorType object = new SubjectedObjectSelectorType(); PrismContainerValue value = asPrismContainerValue().clone(); object.setupContainerValue(value); return object; }
public List<SpecialObjectSpecificationType> createSpecialList() { PrismForJAXBUtil.createProperty(asPrismContainerValue(), F_SPECIAL); return getSpecial(); }
public SubjectedObjectSelectorType special(SpecialObjectSpecificationType value) { getSpecial().add(value); return this; }
@Override public boolean equals(Object object) { if (!(object instanceof SubjectedObjectSelectorType)) { return false; } SubjectedObjectSelectorType other = ((SubjectedObjectSelectorType) object); return asPrismContainerValue().equivalent(other.asPrismContainerValue()); }
public SearchFilterType beginFilter() { SearchFilterType value = new SearchFilterType(); filter(value); return value; }
@Test public void test000Sanity() throws Exception { final String TEST_NAME = "test000Sanity"; TestUtil.displayTestTitle(this, TEST_NAME); assertLoggedInUsername(USER_ADMINISTRATOR_USERNAME); // WHEN PrismObject<RoleType> roleSelf = getRole(ROLE_SELF_OID); // THEN display("Role self", roleSelf); List<AuthorizationType> authorizations = roleSelf.asObjectable().getAuthorization(); assertEquals("Wrong number of authorizations", 2, authorizations.size()); AuthorizationType authRead = findAutz(authorizations, ModelAuthorizationAction.READ.getUrl()); assertEquals("Wrong action in authorization", ModelAuthorizationAction.READ.getUrl(), authRead.getAction().get(0)); List<OwnedObjectSelectorType> objectSpecs = authRead.getObject(); assertEquals("Wrong number of object specs in authorization", 1, objectSpecs.size()); SubjectedObjectSelectorType objectSpec = objectSpecs.get(0); List<SpecialObjectSpecificationType> specials = objectSpec.getSpecial(); assertEquals("Wrong number of specials in object specs in authorization", 1, specials.size()); SpecialObjectSpecificationType special = specials.get(0); assertEquals("Wrong special in object specs in authorization", SpecialObjectSpecificationType.SELF, special); }
@XmlSchemaType(name = "string") @XmlElement(name = "special") public List<SpecialObjectSpecificationType> getSpecial() { return PrismForJAXBUtil.getPropertyValues(asPrismContainerValue(), F_SPECIAL, SpecialObjectSpecificationType.class); }
OrgRelationObjectSpecificationType specOrgRelation = objectSelector.getOrgRelation(); RoleRelationObjectSpecificationType specRoleRelation = objectSelector.getRoleRelation(); List<SpecialObjectSpecificationType> specSpecial = objectSelector.getSpecial(); if (specSpecial != null && !specSpecial.isEmpty()) { if (objectSelector.getFilter() != null || objectSelector.getOrgRef() != null || specOrgRelation != null || specRoleRelation != null) { throw new SchemaException("Both filter/org/role and special "+desc+" specification specified in "+autzHumanReadableDesc); if (BooleanUtils.isTrue(delegatorSpec.isAllowInactive())) { for (AssignmentType objectAssignment: ((UserType)object.asObjectable()).getAssignment()) { ObjectReferenceType objectAssignmentTargetRef = objectAssignment.getTargetRef();
/** * Create an instance of {@link SubjectedObjectSelectorType } * */ public SubjectedObjectSelectorType createSubjectedObjectSelectorType() { return new SubjectedObjectSelectorType(); }
@XmlElement(name = "roleRelation") public RoleRelationObjectSpecificationType getRoleRelation() { return PrismForJAXBUtil.getFieldSingleContainerable(asPrismContainerValue(), F_ROLE_RELATION, RoleRelationObjectSpecificationType.class); }
/** * Create an instance of {@link SubjectedObjectSelectorType } * */ public SubjectedObjectSelectorType createSubjectedObjectSelectorType() { return new SubjectedObjectSelectorType(); }
@Override public int hashCode() { return asPrismContainerValue().hashCode(); }
public SubjectedObjectSelectorType beginOwner() { SubjectedObjectSelectorType value = new SubjectedObjectSelectorType(); owner(value); return value; }
@XmlElement(name = "orgRelation") public OrgRelationObjectSpecificationType getOrgRelation() { return PrismForJAXBUtil.getFieldSingleContainerable(asPrismContainerValue(), F_ORG_RELATION, OrgRelationObjectSpecificationType.class); }
public SubjectedObjectSelectorType beginDelegator() { SubjectedObjectSelectorType value = new SubjectedObjectSelectorType(); delegator(value); return value; }
@XmlElement(defaultValue = "false", name = "allowInactive") public Boolean isAllowInactive() { return PrismForJAXBUtil.getPropertyValue(asPrismContainerValue(), F_ALLOW_INACTIVE, Boolean.class); }
public SubjectedObjectSelectorType beginRequester() { SubjectedObjectSelectorType value = new SubjectedObjectSelectorType(); requester(value); return value; }
@Override public String toString() { return asPrismContainerValue().toString(); }