Skip to content

Passing multiple Trees as array to nodes to WebDAV Server instance? #146

@joeherold

Description

@joeherold

Is it possible to add an array of multiple tree objects to the node attribute?
Idea behind is a CMS business-logic, where in the backend an administrator may define multiple root folders out of a complete tree structure for separate users and groups what they have access to.

// import dependencies
var path = require("path");
var jsDAV = require("jsDAV/lib/jsdav");
var jsDAV_FS_Tree = require("jsDAV/lib/DAV/backends/fs/tree");
var jsDAV_Locks_Backend_FS = require("jsDAV/lib/DAV/plugins/locks/fs");

// file locks
var fileLocks = jsDAV_Locks_Backend_FS.new(__dirname + "/locks/files");

// create an array of trees here
var treeArray = [];
treeArray.push(jsDAV_FS_Tree.new(path.join(__dirname,"/path/to/root1")));
treeArray.push(jsDAV_FS_Tree.new(path.join(__dirname,"/path/to/another/root2")));
treeArray.push(jsDAV_FS_Tree.new(path.join(__dirname,"/path/also/to/another/root3")));

// passing the array... does this work?
jsDAV.createServer({
    node: treeArray, // IS THIS POSSIBLE?
    locksBackend: fileLocks
}, 8000);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions