Examples of IPermissionEntity


Examples of com.zycus.pm.api.bo.IPermissionEntity

   */
  public boolean isRightPermitted(BaseRight right, IPermissionEntity entity, IPermisibleResource resource) {
    validateNullEntries(permissionStore);

    IPermisibleResource parentResource = resource;
    IPermissionEntity parentEntity = entity;

    List<Permission> rights = permissionStore.getRights(parentEntity, parentResource);
    while (parentResource != null) {
      if (isRightPresent(rights, right)) {// means this entity is assigned
        // the right
        return isRightAllowedByPriority(right, rights);
      } else {
        while (parentEntity != null) {
          if (isRightPresent(rights, right)) {
            // means this entity is assigned the right
            return isRightAllowedByPriority(right, rights);
          }
          // increase the parent entity
          parentEntity = parentEntity.getParent();
          rights = permissionStore.getRights(parentEntity, parentResource);
        }
      }
      /*
       * if parent is present and the parent type is not as sane as
View Full Code Here

Examples of com.zycus.pm.api.bo.IPermissionEntity

   */
  public boolean isRightPermitted(BaseRight right, IPermissionEntity entity, IPermisibleResource resource) {
    validateNullEntries(permissionStore);

    Permission answer = null;
    IPermissionEntity currentEntity = entity;
    IPermisibleResource currentResource = resource;

    while (currentEntity != null) {
      while (currentResource != null) {
        if ((answer = getRight(currentEntity, currentResource, right)) == null) {
          // answer = checkForAnyLevel(right, entity, resource);
        }
        IPermisibleResource parentResource = currentResource.getParent();
        currentResource = (parentResource == null) ? currentResource : parentResource;
        if (answer != null || parentResource == null) {
          break;
        }
      }

      if (answer != null) {
        break;
      } else {
        IPermissionEntity parentEntity = currentEntity.getParent();
        currentEntity = (parentEntity == null) ? currentEntity : parentEntity;
        if (parentEntity == null) {
          break;
        }
      }
View Full Code Here

Examples of com.zycus.pm.api.bo.IPermissionEntity

    List<RightsGroup> lstRightGroup = permissionManager.getAllAssociatedGroups(resource);
    System.out.println(lstRightGroup);
  }

  public void assignRights() {
    IPermissionEntity entity = getDummyEntity();
    IPermisibleResource resource = getDummyResource();

    try {
      // Getting required rights from the API at the beginning
      BaseRight editRight = permissionRights.getBaseRight("Add-Edit-Delete", "Edit");
View Full Code Here

Examples of com.zycus.pm.api.bo.IPermissionEntity

      a_excp.printStackTrace();
    }
  }
 
  public void checkRights() {
    IPermissionEntity entity = getDummyEntity();
    IPermisibleResource resource = getDummyResource();
   
    try {
      //Getting required rights from the API at the beginning
      BaseRight addRight = permissionRights.getBaseRight("Add-Edit-Delete", "Add");
View Full Code Here

Examples of com.zycus.pm.api.bo.IPermissionEntity

      a_excp.printStackTrace();
    }
  }
 
  public void checkRightsHirerchy() {
    IPermissionEntity entity = getDummyChildEntity();
    IPermisibleResource resource = getDummyResource();
    IPermisibleResource childResource = getDummyChildResource();
   
    try {
      //Getting required rights from the API at the beginning
View Full Code Here

Examples of com.zycus.pm.api.bo.IPermissionEntity

      this.permissionStore = a_permissionStore;
    }
  }
 
  private IPermissionEntity getDummyChildEntity() {
    IPermissionEntity entity = new IPermissionEntity() {

      public long getEntityID() {
        return 44;
      }
View Full Code Here

Examples of com.zycus.pm.api.bo.IPermissionEntity

    };   
    return entity;
  }
 
  private IPermissionEntity getDummyEntity() {
    IPermissionEntity entity = new IPermissionEntity() {

      public long getEntityID() {
        return 43;
      }
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.