Examples of doesUserHavePermission()


Examples of com.dotmarketing.business.PermissionAPI.doesUserHavePermission()

        for (Map<String, String> map: list) {
          permissionable = (WebAsset) c.newInstance();
          permissionable.setIdentifier(map.get("identifier"));
          permissionable.setInode(map.get("inode"));
         
          if (permAPI.doesUserHavePermission(permissionable, PermissionAPI.PERMISSION_READ, user, false)) {
            assetsList.add(permissionable);
            if (limit < assetsList.size())
              break;
          }
        }
View Full Code Here

Examples of com.dotmarketing.business.PermissionAPI.doesUserHavePermission()

          PermissionAPI perAPI = APILocator.getPermissionAPI();
          IdentifierAPI identAPI = APILocator.getIdentifierAPI();

          for(Map<String, String> ident:contentIdentifiers){
            Identifier identifier = identAPI.find(ident.get("content_ident"));
            if(perAPI.doesUserHavePermission(identifier, PermissionAPI.PERMISSION_READ, user)){
              Map<String, String> h = new HashMap<String, String>();
              h.put("identifier", ident.get("content_ident"));
              h.put("numberOfViews", ident.get("numberOfViews"));
              result.add(h);
            }
View Full Code Here

Examples of com.dotmarketing.business.PermissionAPI.doesUserHavePermission()

  public void _checkUserPermissions(Inode webAsset, User user, int permission) throws ActionException, DotDataException {
    // Checking permissions
    if (!InodeUtils.isSet(webAsset.getInode()))
      return;
    PermissionAPI perAPI = APILocator.getPermissionAPI();
    if (!perAPI.doesUserHavePermission(webAsset, permission, user)) {
      Logger.debug(DeliverCampaignThread.class, "_checkUserPermissions: user does not have permissions ( " + permission + " ) over this asset: " + webAsset);
      throw new ActionException(WebKeys.USER_PERMISSIONS_EXCEPTION);
    }
  }
View Full Code Here

Examples of com.dotmarketing.business.PermissionAPI.doesUserHavePermission()

      if (localTransaction) {
        HibernateUtil.startTransaction();
      }
      PermissionAPI papi = APILocator.getPermissionAPI();
      if (!papi.doesUserHavePermission(folder, PermissionAPI.PERMISSION_EDIT_PERMISSIONS, user)) {
        Logger.error(this.getClass(), "User " + user.getUserId() + " does not have permissions to folder " + folder.getInode());
        throw new DotSecurityException("User " + "does not have edit permissions on folder " + folder.getTitle());
      }

      Folder faker = new Folder();
View Full Code Here

Examples of com.dotmarketing.business.PermissionAPI.doesUserHavePermission()

                    }

                  }else{
                    com.dotmarketing.portlets.files.model.File f = new com.dotmarketing.portlets.files.model.File();
                        (f).setIdentifier(ident.getInode());
                        canRead = permissionAPI.doesUserHavePermission(f, PermissionAPI.PERMISSION_READ, user, true);
              f = null;
                  }

          if (!canRead) {
View Full Code Here

Examples of com.dotmarketing.business.PermissionAPI.doesUserHavePermission()

      if(p==null) return null;

      asset.setIsFolder(p instanceof Folder);
      asset.setIsHost((p instanceof Host) || ((p instanceof Contentlet) && ((Contentlet)p).getStructureInode().equals(hostStrucuture.getInode())));
      asset.setIsParentPermissionable(p.isParentPermissionable());
      asset.setDoesUserHavePermissionsToEdit(permAPI.doesUserHavePermission(p, PermissionAPI.PERMISSION_EDIT_PERMISSIONS, user));
    } catch(DotHibernateException de) {
      throw de;
    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

Examples of com.dotmarketing.business.PermissionAPI.doesUserHavePermission()

    for (Field field : fields) {
      if(field.getFieldType().equals(Field.FieldType.CATEGORY.toString())){
        try {
          Category category = categoryAPI.find(field.getValues(), user, respectFrontendRoles);

          if(!perAPI.doesUserHavePermission(category, perAPI.PERMISSION_READ, user))
            continue;

          Map<String, Object> catMap = category.getMap();
          String categoryName = (String) catMap.get("categoryName");
          catMap.put("categoryOrigName", categoryName);
View Full Code Here

Examples of com.dotmarketing.business.PermissionAPI.doesUserHavePermission()

    @Override
    public void delete(Structure st, User user) throws DotSecurityException, DotDataException, DotStateException {       
        // check for write permissions
        PermissionAPI perAPI=APILocator.getPermissionAPI();
        if(!perAPI.doesUserHavePermission(st, PermissionAPI.PERMISSION_WRITE, user))
            throw new DotSecurityException("User doesn't have permission to delete the structure");

     // checking if there is containers using this structure
         List<Container> containers=APILocator.getContainerAPI().findContainersForStructure(st.getInode());
         Map<String, String> containersInUse = new HashMap<String, String>();
View Full Code Here

Examples of com.dotmarketing.business.PermissionAPI.doesUserHavePermission()

      csList = APILocator.getContainerAPI().getContainerStructures(cont);

      for (ContainerStructure cs : csList) {
        Map<String, String> result = new HashMap<String, String>();
        Structure st = StructureCache.getStructureByInode(cs.getStructureId());
        if(permissionAPI.doesUserHavePermission(st, PERMISSION_WRITE, user)){
          result.put("inode", cs.getStructureId());
          result.put("name", st.getName());
          resultList.add(result);
        }
      }
View Full Code Here

Examples of com.dotmarketing.business.PermissionAPI.doesUserHavePermission()

            return;
        }

        User user = APILocator.getUserAPI().loadUserById(userId,APILocator.getUserAPI().getSystemUser(),false);
        PermissionAPI perAPI = APILocator.getPermissionAPI();
        if (c.getUserId().equalsIgnoreCase(userId) || perAPI.doesUserHavePermission(c,PermissionAPI.PERMISSION_WRITE,user))
        {
            List recipients = RecipientFactory.getAllRecipientsByCampaign(c);
            Iterator i = recipients.iterator();

            while (i.hasNext()) {
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.