Examples of canWrite()


Examples of org.hive2hive.core.model.FileIndex.canWrite()

    Assert.assertTrue(indexB.isShared());

    // check write access
    Assert.assertTrue(indexA.canWrite());
    // user B isn't allowed to write
    Assert.assertFalse(indexB.canWrite());

    // check if md5 hash is the same
    Assert.assertTrue(Arrays.equals(indexA.getMD5(), md5Hash));
    Assert.assertTrue(Arrays.equals(indexB.getMD5(), md5Hash));
View Full Code Here

Examples of org.hive2hive.core.model.FolderIndex.canWrite()

      // get and check the file nodes to be rearranged
      FolderIndex oldParent = (FolderIndex) userProfile.getFileById(oldParentKey);
      if (oldParent == null) {
        logger.error("Could not find the old parent.");
        return;
      } else if (!oldParent.canWrite(sender)) {
        logger.error("User was not allowed to change the source directory.");
        return;
      }

      Index child = oldParent.getChildByName(sourceFileName);
View Full Code Here

Examples of org.hive2hive.core.model.Index.canWrite()

    Assert.assertTrue(indexNew.getProtectionKeys().getPrivate()
        .equals(userProfileA.getProtectionKeys().getPrivate()));
    Assert.assertTrue(indexNew.getProtectionKeys().getPublic()
        .equals(userProfileA.getProtectionKeys().getPublic()));
    // check write access
    Assert.assertTrue(indexNew.canWrite());
    // check user permissions
    Set<String> users = indexNew.getCalculatedUserList();
    Assert.assertEquals(1, users.size());
    Assert.assertTrue(users.contains(userProfileA.getUserId()));
    // check user permissions in case of a folder
View Full Code Here

Examples of org.jnode.fs.FSAccessRights.canWrite()

     *
     * @param file
     */
    public boolean canWrite(String file) throws IOException {
        final FSAccessRights rights = getAccessRights(file);
        return (rights == null) || rights.canWrite();
    }

    /**
     * Can the given file be executed to?
     *
 
View Full Code Here

Examples of org.jruby.util.JRubyFile.canWrite()

                    // when the directory for the file doesn't exist.
                    // Java in such cases just throws IOException.
                    File parent = theFile.getParentFile();
                    if (parent != null && parent != theFile && !parent.exists()) {
                        throw new FileNotFoundException(path);
                    } else if (!theFile.canWrite()) {
                        throw new PermissionDeniedException(path);
                    } else {
                        // for all other IO errors, just re-throw the original exception
                        throw ioe;
                    }
View Full Code Here

Examples of org.meshcms.core.UserInfo.canWrite()

      }
    } else {
      l.add(a1 + adminRelPath.add("index.jsp") + a2 + bundle.getString("homeTitle") + a3);

      if (!isEdit) {
        if (user.canWrite(webSite, pagePath)) {
          if (webSite.isVisuallyEditable(pagePath)) {
            l.add(a1 + request.getRequestURI() + '?' + HitFilter.ACTION_NAME +
                '=' + HitFilter.ACTION_EDIT + a2 +
                bundle.getString("adminEditPage") + a3);
          }
View Full Code Here

Examples of org.olat.core.util.servlets.VFSDirContext.canWrite()

      // Check if operation allowed by OLAT VFS security callback
      DirContext resources = getResources(req);
      VFSDirContext vfsContext = (VFSDirContext) resources;
      String path = getRelativePath(req);
      if (!vfsContext.canWrite(path)) {
        resp.sendError(WebdavStatus.SC_FORBIDDEN);
        return;         
      }

      super.doPut(req, resp);
View Full Code Here

Examples of org.olat.core.util.vfs.VFSContainer.canWrite()

  }

  private void renderList(Renderer r, StringOutput target, FolderComponent fc, URLBuilder ubu, Translator translator, boolean iframePostEnabled) {
   
    VFSContainer currentContainer = fc.getCurrentContainer();
    boolean canWrite = currentContainer.canWrite() == VFSConstants.YES;
    boolean canDelete = false;
    boolean canVersion = FolderConfig.versionsEnabled(fc.getCurrentContainer());
    for (Iterator<VFSItem> iter = fc.getCurrentContainerChildren().iterator(); iter.hasNext();) {
      VFSItem child = iter.next();
      if (child.canDelete() == VFSConstants.YES) {
View Full Code Here

Examples of org.olat.core.util.vfs.VFSItem.canWrite()

        // container node
        String filePath = parentPath + childName + "/";
        GenericTreeNode tChild = new GenericTreeNode(childName, filePath); // filePath is the information to be remembered later
        tChild.setIconCssClass("b_filetype_folder");
        tChild.setAltText(child.getName());
        tChild.setAccessible(selectableFolders ? (child.canWrite() == VFSConstants.YES) : false);
        tParent.addChild(tChild);
        boolean addedChildren = buildTree(tChild, (VFSContainer)child, filePath);
        if (foldersOnly || addedChildren) {
          addedAtLeastOneChild = true;
        } else {
View Full Code Here

Examples of org.olat.core.util.vfs.callbacks.VFSSecurityCallback.canWrite()

    VFSSecurityCallback secCallback = VFSManager.findInheritedSecurityCallback(container);
    if (secCallback != null) {
      if (secCallback.canDeleteRevisionsPermanently()) {
        deletedFilesListTableCtr.addMultiSelectAction("delete", CMD_DELETE);
      }
      if (secCallback.canWrite()) {
        deletedFilesListTableCtr.addMultiSelectAction("version.restore", CMD_RESTORE);
      }
    }

    deletedFilesListTableCtr.addMultiSelectAction("cancel", CMD_CANCEL);
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.