Package org.jresearch.flexess.core.model.impl

Examples of org.jresearch.flexess.core.model.impl.DynamicRoleMetaInfo


  public IDynamicRoleMetaInfo getDynamicRoleImpl(String modelId) throws ObjectNotFoundException {
    ModelMetaInfo mm = (ModelMetaInfo) modelService.getSerializedModel(modelId);
    if (mm == null) {
      throw new ObjectNotFoundException(MessageFormat.format("Model {0} is not found", modelId), modelId); //$NON-NLS-1$
    }
    DynamicRoleMetaInfo newRole = new DynamicRoleMetaInfo();
    newRole.setModelId(modelId);
    return newRole;
  }
View Full Code Here


    dynamicRoleDAO.deleteRoles(applicationId);
  }

  @Override
  public void assignPermissions(String roleId, Set<IPermissionMetaInfo> permissions) throws ObjectNotFoundException {
    DynamicRoleMetaInfo role = (DynamicRoleMetaInfo) getDynamicRole(roleId);
    if (role == null) {
      throw new ObjectNotFoundException("Dynamic role is not found", roleId); //$NON-NLS-1$
    }
    String modelId = role.getModelId();
    List<IRoleInstanceMetaInfo> instances = roleInstanceService.getRoleInstances(modelId, role.getId());
    Set<PermissionRole> oldPermissions = role.getPermissionRoles();
    if (permissions == null) {
      oldPermissions.clear();
      dynamicRoleDAO.saveDynamicRole(role);
      return;
    }
View Full Code Here

  @Override
  public IDynamicRoleMetaInfo getDynamicRole(String id) throws ObjectNotFoundException {
    // DynamicRoleMetaInfo role =
    // getHibernateTemplate().get(DynamicRoleMetaInfo.class, id);
    DynamicRoleMetaInfo role = get(id);
    if (role != null) {
      loadDynamicRole(role);
    }
    return role;
  }
View Full Code Here

    // if (ur == null || ur.isEmpty()) {
    // return null;
    // }
    // DynamicRoleMetaInfo role = ur.get(0);
    try {
      DynamicRoleMetaInfo role = getQuery("where modelId=?1 and name=?2", modelId, name).getSingleResult();
      loadDynamicRole(role);
      return role;
    } catch (NoResultException e) {
      return null;
    }
View Full Code Here

  }

  @Override
  public void assignPermissions(String dynamicRoleId, Set<IPermissionMetaInfo> permissions) throws ObjectNotFoundException {
    DynamicRoleMetaInfo role = (DynamicRoleMetaInfo) getDynamicRole(dynamicRoleId);
    if (role == null) {
      throw new ObjectNotFoundException("Dynamic role is not found", dynamicRoleId);
    }
    String appId = role.getModelId();
    Set<PermissionRole> perm = role.getPermissionRoles();
    if (permissions == null) {
      perm.clear();
      save(role);
      // getHibernateTemplate().save(role);
      return;
View Full Code Here

TOP

Related Classes of org.jresearch.flexess.core.model.impl.DynamicRoleMetaInfo

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.