Examples of IRoleMetaInfo


Examples of org.jresearch.flexess.core.model.IRoleMetaInfo

    return role;
  }

  @Override
  public IRoleMetaInfo findRole(String applicationId, String name) throws ObjectNotFoundException {
    IRoleMetaInfo role = roleDAO.findRole(applicationId, name);
    if (role != null)
      return role;
    return dynamicRoleDAO.findDynamicRole(applicationId, name);
  }
View Full Code Here

Examples of org.jresearch.flexess.core.model.IRoleMetaInfo

    return role;
  }

  @Override
  public IRoleMetaInfo getRole(String applicationId, String id) throws ObjectNotFoundException {
    IRoleMetaInfo role = roleDAO.getRole(applicationId, id);
    if (role != null)
      return role;
    return getDynamicRole(id);
  }
View Full Code Here

Examples of org.jresearch.flexess.core.model.IRoleMetaInfo

  }

  @Override
  public void executeRule(IRuleDefinition e) throws RuleExecutionException {
    Role role = (Role) e.getSource();
    IRoleMetaInfo roleMetaInfo = null;
    String modelId = ((SecurityModel) role.getEPackage()).getId();
    try {
      roleMetaInfo = roleService.findDynamicRole(modelId, role.getName());
    } catch (ObjectNotFoundException e1) {
      throw new RuleExecutionException(modelId, "Model is not found.");
View Full Code Here

Examples of org.jresearch.flexess.core.model.IRoleMetaInfo

  }

  private String getRoleId() throws ObjectNotFoundException {
    String rId = id;
    if (rId == null) {
      IRoleMetaInfo findRole = roleService.findRole("com.jresearchsoft.flexess.examples.orders", "superAdmmm"); //$NON-NLS-1$ //$NON-NLS-2$
      if (findRole == null) {
        findRole = roleService.findRole("com.jresearchsoft.flexess.examples.orders", "superadm"); //$NON-NLS-1$ //$NON-NLS-2$
      }
      rId = findRole == null ? null : findRole.getId();
    }
    return rId;
  }
View Full Code Here

Examples of org.jresearch.flexess.core.model.IRoleMetaInfo

   * @return created role instance
   * @throws ObjectNotFoundException
   *             - if model or role template with given id wasn't found
   */
  public IRoleInstanceMetaInfo createRoleInstance(String modelId, String roleTemplateId) throws ObjectNotFoundException {
    IRoleMetaInfo roleMetaInfo = roleService.getRole(modelId, roleTemplateId);
    if (roleMetaInfo == null) {
      throw new ObjectNotFoundException(MessageFormat.format("Can''t find role template with id {0} in the model {1}.", roleTemplateId, modelId), roleTemplateId); //$NON-NLS-1$
    }
    return createRoleInstance(roleMetaInfo);
  }
View Full Code Here

Examples of org.jresearch.flexess.core.model.IRoleMetaInfo

public class Role3Test extends BaseMetaTest {

  @Test
  public void testGetRoles() throws Exception {
    // IRoleService roleService = getRoleService();
    IRoleMetaInfo role = roleService.getRole("com.jresearchsoft.flexess.examples.orders", "_mUTIQMr9Eduhuu4mIe0M6A"); //$NON-NLS-1$ //$NON-NLS-2$
    assertNotNull(role);
    IRoleMetaInfo role2 = roleService.findRole("com.jresearchsoft.flexess.examples.orders", "Customer"); //$NON-NLS-1$ //$NON-NLS-2$
    assertNotNull(role2);

    SortedSet<IPermissionMetaInfo> perm = role.getPermissions();
    assertNotNull(perm);
    assertEquals(perm.size(), 1);
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.