Examples of POperation


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

    this.policyEvaluator = policyEvaluator;
  }

  @Override
  public boolean check(List<EObject> roleInstances, EObject object, String operation) throws OperationNotFoundException {
    POperation po = operationMatcher.findOperation((PObject) object.eClass(), operation);
    if (po == null) {
      throw new OperationNotFoundException(MessageFormat.format("Operation {0} can''t be found.", operation), operation);
    }
    return policyEvaluator.evaluate(roleInstances, object, po);
  }
View Full Code Here

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

    // 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");
View Full Code Here

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

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

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

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

    for (Iterator<EAttribute> it = permission.getEAttributes().iterator(); it.hasNext();) {
      EAttribute attr = it.next();
      createMetaAttribute(pm, attr);
    }
    for (Iterator<POperation> it = permission.getPOperation().iterator(); it.hasNext();) {
      POperation pop = it.next();
      ElementDescription ed = createElementDescription(pop);
      pm.addOperation(ed);
    }
    for (Iterator<Role> it = EMFUtil.getRoles(permission).iterator(); it.hasNext();) {
      Role role = it.next();
View Full Code Here

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

  }

  @SuppressWarnings("unchecked")
  @Override
  public POperation rawConvert() throws LoadModelException {
    POperation result = super.rawConvert();
    for (PermissionType permission : getXmlElement().getPermission()) {
      result.getPermission().add(new PermissionConverter(permission, getConverted()).convert());
    }
    return result;
  }
View Full Code Here

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

    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());
    }
View Full Code Here

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

    userID.setName("userId"); //$NON-NLS-1$
    userID.setEType(EcorePackage.eINSTANCE.getEString());
    order.getEStructuralFeatures().add(userID);

    // Now we create basic operations and add them to order
    POperation createOp = UamFactory.eINSTANCE.createPOperation();
    createOp.setId("create_operation"); //$NON-NLS-1$
    createOp.setName("create"); //$NON-NLS-1$

    POperation viewOp = UamFactory.eINSTANCE.createPOperation();
    viewOp.setId("view_operation"); //$NON-NLS-1$
    viewOp.setName("view"); //$NON-NLS-1$

    POperation deleteOp = UamFactory.eINSTANCE.createPOperation();
    deleteOp.setId("delete_operation"); //$NON-NLS-1$
    deleteOp.setName("delete"); //$NON-NLS-1$

    POperation updateOp = UamFactory.eINSTANCE.createPOperation();
    updateOp.setId("update_operation"); //$NON-NLS-1$
    updateOp.setName("update"); //$NON-NLS-1$

    order.getEOperations().add(createOp);
    order.getEOperations().add(viewOp);
    order.getEOperations().add(deleteOp);
    order.getEOperations().add(updateOp);
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.