How to use the @pylonide/jsdav/lib/shared/exceptions.Forbidden function in @pylonide/jsdav

To help you get started, we’ve selected a few @pylonide/jsdav examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pylonide / pylon / plugins-server / pylon.fs / fs / tree.js View on Github external
copy: function(source, destination, callback) {
    var self = this;
    source = this.getRealPath(source);
    destination = this.getRealPath(destination);
    if (!this.insideSandbox(destination)) {
      return callback(new Exc.Forbidden("You are not allowed to copy to " +
                      this.stripSandbox(destination)));
    }

    // first check if source exists
    this.vfs.stat(source, {}, function(err, stat) {
      if (err || stat.err)
        return callback(err);

      // if destination exists try to delete it
      self.vfs.rmdir(destination, { recursive: true }, function(err) {
        // ignore error because destination may not exists
        self.vfs.execFile("cp", {args: ["-R", source, destination]}, callback);
      });
    });
  },
github pylonide / pylon / plugins-server / pylon.fs / fs / file.js View on Github external
this.vfs.mkfile(path, {}, function(err, meta) {
        if (err) {
          if (err.code == "EACCES")
            err = new Exc.Forbidden("Permission denied to write file:" + path);
          return callback(err);
        }

        handler.getRequestBody(type, meta.stream, false, callback);
      });
    }

@pylonide/jsdav

jsDAV allows you to easily add WebDAV support to a NodeJS application. jsDAV is meant to cover the entire standard, and attempts to allow integration using an easy to understand API.

MIT
Latest version published 4 months ago

Package Health Score

66 / 100
Full package analysis

Similar packages