Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sample from https://github.com/OpenMarshal/npm-WebDAV-Server/issues/41 does not work #104

Open
nenadlazovic opened this issue Sep 12, 2021 · 0 comments

Comments

@nenadlazovic
Copy link

Hi,
sample given in #41 does not work. Server runs, but nor home/111 nor work/111 user are not able to login. (using 2.6.2)

const webdav = require('webdav').v2;

const userManager = new webdav.SimpleUserManager();
const userH = userManager.addUser('home', '111', false);
const userW = userManager.addUser('work', '111', false);

const privilegeManager = new webdav.SimplePathPrivilegeManager();
privilegeManager.setRights(userH, '/home', [ 'all' ]);
privilegeManager.setRights(userW, '/work', [ 'all' ]);

const server = new webdav.WebDAVServer({
    httpAuthentication: new webdav.HTTPDigestAuthentication(userManager, 'Default realm'),
    privilegeManager: privilegeManager
});

const fs = server.rootFileSystem();
fs.addSubTree(server.createExternalContext(), {
    home: webdav.ResourceType.Directory,
    work: webdav.ResourceType.Directory
});

server.start(() => console.log('READY'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant