Examples of IRoleInstanceService


Examples of org.jresearch.flexess.core.services.IRoleInstanceService

  public void testCreateRoleInstance() throws Exception {
    createRoleInstance();
  }

  private void createRoleInstance() throws Exception {
    IRoleInstanceService roleInstService = getRoleInstService();
    assertNotNull(roleInstService);

    IRoleInstanceMetaInfo rm = roleInstService.findRoleInstance("com.jresearchsoft.flexess.examples.orders", "manager_role", "european manager");

    // getUserRoleService().addUserRole("bel", rm);

  }
View Full Code Here

Examples of org.jresearch.flexess.core.services.IRoleInstanceService

    id1 = pm.getId();

  }

  private void createRoleInstance() throws Exception {
    IRoleInstanceService roleInstService = getRoleInstService();
    assertNotNull(roleInstService);

    IPermissionInstanceService permissionService = getPermissionInstanceService();
    assertNotNull(permissionService);
    IPermissionInstanceMetaInfo rpm = permissionService.getPermissionInstance(id1);
    assertNotNull(rpm);

    IRoleInstanceMetaInfo rm = roleInstService.getRoleInstanceImpl("com.jresearchsoft.flexess.examples.orders"); //$NON-NLS-1$
    rm.setName("european manager"); //$NON-NLS-1$
    rm.setRoleId("manager_role"); //$NON-NLS-1$

    rm.addPermissionInstance(rpm);
    rm = roleInstService.saveRoleInstance(rm);
    id2 = rm.getId();
  }
View Full Code Here

Examples of org.jresearch.flexess.core.services.IRoleInstanceService

    rm = roleInstService.saveRoleInstance(rm);
    id2 = rm.getId();
  }

  private void getRoleInstance() throws Exception {
    IRoleInstanceService roleInstService = getRoleInstService();
    assertNotNull(roleInstService);

    assertTrue(roleInstService.getRoleInstances().size() > 0);
    IRoleInstanceMetaInfo rm = roleInstService.getRoleInstance(id2);

    assertNotNull(rm);
    assertEquals(rm.getName(), "european manager"); //$NON-NLS-1$
    assertEquals(rm.getRoleId(), "manager_role"); //$NON-NLS-1$

    rm = roleInstService.findRoleInstance("com.jresearchsoft.flexess.examples.orders", "manager_role", "european manager"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertNotNull(rm);
    assertEquals(rm.getName(), "european manager"); //$NON-NLS-1$
    assertEquals(rm.getRoleId(), "manager_role"); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.jresearch.flexess.core.services.IRoleInstanceService

    assertEquals(rm.getName(), "european manager"); //$NON-NLS-1$
    assertEquals(rm.getRoleId(), "manager_role"); //$NON-NLS-1$
  }

  private void updateRoleInstance() throws Exception {
    IRoleInstanceService roleInstService = getRoleInstService();
    IRoleInstanceMetaInfo rm = roleInstService.getRoleInstance(id2);
    rm.setName("european manager2"); //$NON-NLS-1$
    roleInstService.saveRoleInstance(rm);
  }
View Full Code Here

Examples of org.jresearch.flexess.core.services.IRoleInstanceService

    rm.setName("european manager2"); //$NON-NLS-1$
    roleInstService.saveRoleInstance(rm);
  }

  private void getRoleInstance2() throws Exception {
    IRoleInstanceService roleInstService = getRoleInstService();
    IRoleInstanceMetaInfo rm = roleInstService.getRoleInstance(id2);

    assertNotNull(rm);
    assertEquals(rm.getName(), "european manager2"); //$NON-NLS-1$

    rm = roleInstService.findRoleInstance("com.jresearchsoft.flexess.examples.orders", "manager_role", "european manager2"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertNotNull(rm);
    assertEquals(rm.getName(), "european manager2"); //$NON-NLS-1$
  }
View Full Code Here

Examples of org.jresearch.flexess.core.services.IRoleInstanceService

    assertNotNull(rm);
    assertEquals(rm.getName(), "european manager2"); //$NON-NLS-1$
  }

  private void deleteRoleInstance() throws Exception {
    IRoleInstanceService roleInstService = getRoleInstService();
    roleInstService.deleteRoleInstance(id2);
    assertNull(roleInstService.getRoleInstance(id2));
  }
View Full Code Here

Examples of org.jresearch.flexess.core.services.IRoleInstanceService

public class DeployRejectionTest extends BaseDeployTest {

  public void testDeployReject() throws Exception {
    boolean caught = false;
    try {
      IRoleInstanceService roleInstService = getRoleInstService();
      assertNotNull(roleInstService);

      IRoleInstanceMetaInfo rm = roleInstService.getRoleInstanceImpl("com.jresearchsoft.flexess.examples.orders"); //$NON-NLS-1$
      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) {
View Full Code Here

Examples of org.jresearch.flexess.core.services.IRoleInstanceService

    //    assertEquals(dynaMeta.getName(), "superAdmmm"); //$NON-NLS-1$
    assertEquals(dynaMeta.getName(), "superadm"); //$NON-NLS-1$
    List<IRoleMetaInfo> roles2 = roleService.getAllRoles("com.jresearchsoft.flexess.examples.orders"); //$NON-NLS-1$
    assertEquals(4, roles2.size());

    IRoleInstanceService roleInstService = getRoleInstService();
    assertNotNull(roleInstService);

    IPermissionInstanceService permissionService = getPermissionInstanceService();
    assertNotNull(permissionService);

    IRoleInstanceMetaInfo rm = roleInstService.getRoleInstanceImpl("com.jresearchsoft.flexess.examples.orders"); //$NON-NLS-1$
    rm.setName("super administrator"); //$NON-NLS-1$
    rm.setRoleId(dynaMeta.getId());

    List<IPermissionInstanceMetaInfo> permInstances = permissionService.getPermissionInstances();
    for (IPermissionInstanceMetaInfo info : permInstances) {
      rm.addPermissionInstance(info);
    }
    rm = roleInstService.saveRoleInstance(rm);

    // getUserRoleService().addUserRole("cathy", rm);

    roleService.deleteRole("com.jresearchsoft.flexess.examples.orders", dynaMeta.getId()); //$NON-NLS-1$
View Full Code Here

Examples of org.jresearch.flexess.core.services.IRoleInstanceService

  public void testCreateRoleInstance() throws Exception {
    createRoleInstance();
  }

  private void createRoleInstance() throws Exception {
    IRoleInstanceService roleInstService = getRoleInstService();
    assertNotNull(roleInstService);

    IPermissionInstanceService permissionService = getPermissionInstanceService();
    assertNotNull(permissionService);

    IPermissionService permService = getPermissionService();
    IPermissionMetaInfo perm2 = permService.findPermission("com.jresearchsoft.flexess.examples.orders", "ManagePersonalOrders");
    assertNotNull(perm2);

    IPermissionInstanceMetaInfo pm = permissionService.getPermissionInstanceImpl();
    pm.setPermissionId("user_permission");

    IPermissionParameter param = permissionService.getPermissionParameterImpl();
    param.setPermissionInstance(pm);
    IAttributeMetaInfo am = perm2.getAttribute("uid");

    param.setAttributeName(am.getId());
    pm.addPermissionParameter(param);

    IRoleInstanceMetaInfo rm = roleInstService.getRoleInstanceImpl("com.jresearchsoft.flexess.examples.orders");
    rm.setName("customer");
    rm.setRoleId("customer_role");

    rm = roleInstService.saveRoleInstance(rm);
    id2 = rm.getId();

    pm.setRoleInstance(rm);
    pm = permissionService.savePermissionInstance(pm);
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.