Package org.jresearch.flexess.core.model.uam

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


  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

  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

  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

  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

      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

    return permMeta;
  }

  @Override
  public List<String> getCategories(String modelId) throws ObjectNotFoundException {
    SecurityModel model = getModelById(modelId);
    if (model == null) {
      throw new ObjectNotFoundException("Model is not found", modelId);
    }
    return CategoryManager.getInstance().getCategories(model);
  }
View Full Code Here

  @Test
  @Ignore
  public void testCode() throws Exception {
    List<SecurityModel> cons = getModelService().getEmfModels();
    assertEquals(cons.size(), 4);
    SecurityModel sm1 = cons.iterator().next();
    assertNotNull(sm1);
    SecurityModel sm = modifyModel(sm1);
    String modelString = securityContainerFactory.getSecurityContainer(sm).getModelAsString();
    getDeployService().putModel(sm, modelString);

  }
View Full Code Here

  }

  public void getModel() throws Exception {
    List<SecurityModel> models = getModelService().getEmfModels();
    assertEquals(models.size(), 4);
    SecurityModel model = getModel(models, "com.jresearchsoft.flexess.examples.orders.test");
    assertNotNull(model);
    appId = model.getId();
  }
View Full Code Here

  // java.net.URLClassLoader.findClass(URLClassLoader.java:190) at
  // java.lang.ClassLoader.loadClass(ClassLoader.java:307) at
  // sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at
  // java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 28 more
  public void testConvertModel() throws Exception {
    SecurityModel convert = new ModelConverter(fixture).convert();
    // convert.setNsPrefix("gen");
    // convert.setNsURI("http://www.jresearchsoft.com/schemas/gen");
    Assert.assertNotNull(convert);
    // Diagnostic diagnostic = Diagnostician.INSTANCE.validate(convert);
    // if (diagnostic.getSeverity() != Diagnostic.OK) {
View Full Code Here

TOP

Related Classes of org.jresearch.flexess.core.model.uam.SecurityModel

Copyright © 2018 www.massapicom. 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.