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

user unable to login if SimplePathPrivilegeManager.setRights() is invoked with path other then '/' #105

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

Comments

@nenadlazovic
Copy link

User unable to login if SimplePathPrivilegeManager.setRights() is invoked with path other then '/'. Pls help

If invoked with any path other then '/', it does not allow user to login.

privilegeManager.setRights(user1, '/public', [ 'all' ]);
privilegeManager.setRights(user2, '/private', [ 'all' ]);

If invoked with any path other then '/', it does not allow user to login.

privilegeManager.setRights(user1, '/', [ 'all' ]);
privilegeManager.setRights(user2, '/', [ 'all' ]);

Using webdav-server v2.6.2

sample app

/*
disk contains following directory structure
	/opt/shareddata
		/public
		/private
*/
const userManager = new webdav.SimpleUserManager();
const user1 = userManager.addUser('user1', '111', false);
const user2 = userManager.addUser('user2', '111', false);

const privilegeManager = new webdav.SimplePathPrivilegeManager();
privilegeManager.setRights(user1, '/public', [ 'all' ]);
privilegeManager.setRights(user2, '/private', [ 'all' ]);
// privilegeManager.setRights(user1, '/', [ 'all' ]);
// privilegeManager.setRights(user2, '/', [ 'all' ]);

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

server.setFileSystemSync("/", new webdav.PhysicalFileSystem('/opt/shareddata));

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