Examples of PObject


Examples of org.jresearch.flexess.core.model.uam.PObject

  }

  // TODO UAM-749: implement plugable findPObject
  private static PObject findPObject(final SecurityModel model, final String classname, final Object object) throws PObjectNotFoundException {
    PObject po = null;
    if (object != null && classname.equals(String.class.getName())) {
      po = findCustomPObject(model, object.toString());
    }
    if (po == null) {
      po = findPObject(model, classname);
View Full Code Here

Examples of org.jresearch.flexess.core.model.uam.PObject

   * org.jresearch.flexess.api.IConstraintEvaluator#evaluate(org.eclipse.emf
   * .ecore.EObject)
   */
  @Override
  public boolean evaluate(EObject pObjectInstance, EObject roleInstance, POperation operation) {
    PObject pObject = (PObject) pObjectInstance.eClass();
    Collection<EObject> permissionInstances = findPermission(pObject, roleInstance, operation);
    for (EObject permissionInstance : permissionInstances)
      if (checkPermission(pObjectInstance, permissionInstance))
        return true;
    return false;
View Full Code Here

Examples of org.jresearch.flexess.core.model.uam.PObject

    permission.setConstraint(constraint);
    constraint.setExpession(expression);
    model.getEClassifiers().add(permission);

    // Create protected object with region attribute
    PObject pObject = uamFactory.createPObject();
    pObject.setName("TestProtectedObject");
    EAttribute pObjectRegionAttr = getRegionAttr();
    pObject.getEStructuralFeatures().add(pObjectRegionAttr);
    pObject.getPermission().add(permission);
    // permission.setPObject(pObject);
    // EMFUtil.addPobject(permission, pObject);
    model.getEClassifiers().add(pObject);

    // create operation
    POperation operation = UamFactory.eINSTANCE.createPOperation();
    operation.setName("TestOperation");
    pObject.getEOperations().add(operation);

    // Create role
    Role role = uamFactory.createRole();
    role.setName("TestRole");
    EReference permissionRef = EMFUtil.addPermission(role, permission);
View Full Code Here

Examples of org.jresearch.flexess.core.model.uam.PObject

  protected void tearDown() throws Exception {
    setFixture(null);
  }

  public void testCheck() {
    PObject tested = getFixture();
   
    String iId = "testId";   
    tested.setId(iId);
    assertEquals(iId, tested.getId());
   
    Permission[] permissions = new Permission[]{UamFactory.eINSTANCE.createPermission(), UamFactory.eINSTANCE.createPermission()};
   
    permissions[0].setPObject(tested);
    permissions[1].setPObject(tested);
   
    EList list = tested.getPermission();
   
    assertTrue(list.contains(permissions[0]));
    assertTrue(list.contains(permissions[1]));   
  }
View Full Code Here

Examples of org.jresearch.flexess.core.model.uam.PObject

    String iId = "testId";   
    tested.setId(iId);
    assertEquals(iId, tested.getId());
   
    Constraint iConstraint = UamFactory.eINSTANCE.createConstraint()
    PObject iPObject = UamFactory.eINSTANCE.createPObject();
   
    tested.setConstraint( iConstraint );
    tested.setPObject( iPObject );
   
    assertEquals( iConstraint, tested.getConstraint());
View Full Code Here

Examples of org.jresearch.flexess.core.model.uam.PObject

      Role role = it.next();
      ElementDescription ed = createElementDescription(role);
      pm.addRole(ed);
    }

    PObject po = permission.getPObject();
    if (permission.getPOperation().isEmpty() && po != null) {
      ElementDescription ed = createElementDescription(po);
      pm.setPObjectDescription(ed);
    }
    return pm;
View Full Code Here

Examples of org.jresearch.flexess.core.model.uam.PObject

public class PObjectDAO extends EMFDaoSupport implements IPObjectDAO {

  @Override
  public IPObjectMetaInfo findPObject(String modelId, String name) throws ObjectNotFoundException {
    PObject po = getPObjectByName(modelId, name);
    if (po == null) {
      return null;
    }
    return loadPobject(modelId, po);
  }
View Full Code Here

Examples of org.jresearch.flexess.core.model.uam.PObject

    return loadPobject(modelId, po);
  }

  @Override
  public IPObjectMetaInfo getPObject(String modelId, String id) throws ObjectNotFoundException {
    PObject po = getPObjectById(modelId, id);
    if (po == null) {
      return null;
    }
    return loadPobject(modelId, po);
  }
View Full Code Here

Examples of org.jresearch.flexess.core.model.uam.PObject

  /**
   * <!-- begin-user-doc --> <!-- end-user-doc -->
   */
  public NotificationChain basicSetPObject(PObject newPObject, NotificationChain msgs) {
    PObject oldPObject = pObject;
    pObject = newPObject;
    if (newPObject == null) {
      EMFUtil.removePObject(this);
    } else {
      EMFUtil.addPobject(this, newPObject);
View Full Code Here

Examples of org.jresearch.flexess.core.model.uam.PObject

  }

  @SuppressWarnings("unchecked")
  @Override
  public PObject rawConvert() throws LoadModelException {
    PObject result = super.rawConvert();

    EMFUtil.setAnnotation(result, IPObjectConstant.CLASSNAME_ATTR, getXmlElement().getClass_());
    EMFUtil.setAnnotation(result, IPObjectConstant.MAPPER_ID_ATTR, JAVA_MAPPER_ID);
    EMFUtil.setAnnotation(result, IPObjectConstant.MAPPER_CLASS_NAME_ATTR, ID);

    for (AttributeType attribute : getXmlElement().getObjectAttribute()) {
      result.getEStructuralFeatures().add(new AttributeConverter<AttributeType>(attribute).convert());
    }
    for (ProtectedOperationType xmlOperation : getXmlElement().getOperation()) {
      POperation operation = new OperationConverter(xmlOperation, getConverted()).convert();
      result.getPermission().addAll(operation.getPermission());
      result.getEOperations().add(operation);
    }
    for (PermissionType permission : getXmlElement().getPermission()) {
      result.getPermission().add(new PermissionConverter(permission, getConverted()).convert());
    }
    return result;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.