Examples of SecurityModel


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

public class PutModelTest extends BaseDeployTest {

  @Test
  public void testPutModel() throws Exception {
    SecurityModel sm = OrdersModelGenerator.generateModel();
    String modelString = securityContainerFactory.getSecurityContainer(sm).getModelAsString();
    getDeployService().putModel(sm, modelString);
  }
View Full Code Here

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

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

  public void testCheck() {   
    SecurityModel tested = getFixture();
 
    String iId = "testId";   
    tested.setId(iId);
    assertEquals(iId, tested.getId());
  }
View Full Code Here

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

public class CategoryTest extends TestCase {

  public void testCategories() throws Exception{
   
    SecurityModel pack = UamFactory.eINSTANCE.createSecurityModel();
    Permission perm1 = UamFactory.eINSTANCE.createPermission();
    Permission perm2 = UamFactory.eINSTANCE.createPermission();
    Permission perm3 = UamFactory.eINSTANCE.createPermission();
   
    perm1.setId("p1");
    perm2.setId("p2");
    perm3.setId("p3");
   
    perm1.setName("p1");
    perm2.setName("p2");
    perm3.setName("p3");
   
    pack.getEClassifiers().add(perm1);
    pack.getEClassifiers().add(perm2);
    pack.getEClassifiers().add(perm3);
   
    ICategoryManager manager = CategoryManager.getInstance();
    manager.addCategory("q1", perm1);
    assertEquals(true, manager.hasCategory("q1", perm1));
    manager.addCategory("q2", perm2);
View Full Code Here

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

  public Collection<PObject> getAllPObjects(String modelId) throws ObjectNotFoundException {
    if (!modelDao.hasModel(modelId)) {
      throw new ObjectNotFoundException("Model not found", modelId); //$NON-NLS-1$
    }
    SecurityModel securityModel = modelDao.getSecurityModel(modelId);
    return EcoreUtil.getObjectsByType(securityModel.getEClassifiers(), UamPackage.eINSTANCE.getPObject());
  }
View Full Code Here

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

  public Collection<Permission> getAllPermissions(String modelId) throws ObjectNotFoundException {
    if (!modelDao.hasModel(modelId)) {
      throw new ObjectNotFoundException("Model not found", modelId); //$NON-NLS-1$
    }
    SecurityModel securityModel = modelDao.getSecurityModel(modelId);
    return EcoreUtil.getObjectsByType(securityModel.getEClassifiers(), UamPackage.eINSTANCE.getPermission());
  }
View Full Code Here

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

  public Collection<Role> getAllRoles(String modelId) throws ObjectNotFoundException {
    if (!modelDao.hasModel(modelId)) {
      throw new ObjectNotFoundException("Model not found", modelId); //$NON-NLS-1$
    }
    SecurityModel securityModel = modelDao.getSecurityModel(modelId);
    Collection<Role> roles = EcoreUtil.getObjectsByType(securityModel.getEClassifiers(), UamPackage.eINSTANCE.getRole());
    TreeSet<Role> set = new TreeSet<Role>(new RoleComparator());
    set.addAll(roles);
    return set;
  }
View Full Code Here

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

  public PObject getPObjectByName(String modelId, String name) throws ObjectNotFoundException {
    if (!modelDao.hasModel(modelId)) {
      throw new ObjectNotFoundException("Application not found", modelId);
    }
    SecurityModel securityModel = modelDao.getSecurityModel(modelId);
    Collection<PObject> pobjects = EcoreUtil.getObjectsByType(securityModel.getEClassifiers(), UamPackage.eINSTANCE.getPObject());
    for (PObject object : pobjects) {
      if (object.getName().equals(name)) {
        return object;
      }
    }
View Full Code Here

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

  public Permission getPermissionByName(String modelId, String name) throws ObjectNotFoundException {
    if (!modelDao.hasModel(modelId)) {
      throw new ObjectNotFoundException("Application not found", modelId);
    }
    SecurityModel securityModel = modelDao.getSecurityModel(modelId);
    Collection<Permission> permissions = EcoreUtil.getObjectsByType(securityModel.getEClassifiers(), UamPackage.eINSTANCE.getPermission());
    for (Permission object : permissions) {
      if (object.getName().equals(name)) {
        return object;
      }
    }
View Full Code Here

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

  public Role getRoleByName(String modelId, String name) throws ObjectNotFoundException {
    if (!modelDao.hasModel(modelId)) {
      throw new ObjectNotFoundException("Application not found", modelId);
    }
    SecurityModel securityModel = modelDao.getSecurityModel(modelId);
    Collection<Role> roles = EcoreUtil.getObjectsByType(securityModel.getEClassifiers(), UamPackage.eINSTANCE.getRole());
    for (Role role : roles) {
      if (role.getName().equals(name)) {
        return role;
      }
    }
View Full Code Here

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

      rm.setName("european manager2"); //$NON-NLS-1$
      rm.setRoleId("manager_role"); //$NON-NLS-1$

      rm = roleInstService.saveRoleInstance(rm);
      getUserRoleService().addUserRole("cathy", "appId", rm); //$NON-NLS-1$ //$NON-NLS-2$
      SecurityModel sm = OrdersModelGenerator.generateModel();
      sm.setId("kuku"); //$NON-NLS-1$
      getDeployService().putModel(sm, null);
    } catch (ModelLoadInProgressException e) {
      caught = true;
    }
    assertTrue(caught);
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.