Page 1 of 1

WebDAV strange user permissions changes

PostPosted:Fri Oct 02, 2015 12:21 pm
by bouskam
Hello,
first, I would like to thank author(s) for amazing work, OpenKM seems to be perfect document managing system.

But I probably found one bug - very strange behaviour when accessing root repository through webDAV.
OpenKM version 6.3.0 (build: 8156)
host OS: Linux 32 bit
client: windows machine with WebDrive or native windows Explorer

When I add new user with ROLE_USER,
he can work exactly how expected (with write granted but delete revoked, he can create new folders and upload some documents, but not to delete them)
BUT ... after some days of work, some logins/logouts, some folder creation and some folders permission changes (did not found exact combination to reproduce that again) the permissions became screwed.

Nothing seems to be changed in user configuration, the permissions are looking same as they were, in web interface there are also no changes, everything is still working as before.
But suddenly - this user got a delete privilege for WebDAV sessions.
Other user accounts are untouched, their WebDAV privileges are working fine (which means, they are prohibited of deleting )

Simply, there arrises an inconsistency between web-interface permissions and WebDAV permissions for the one particullar user.

I tried:
Set users role to Admin and back,
Deleted the user, created new with same ID with ROLE_USER,
Recursively set folder permissions (based on roles) to full acess and back for ROLE_USER (in web interface)
Recursively set folder permissions (based on roles) through the script.
created new role, applied this role to user account, set role permissions
....
but nothing helped, the user had still the delete permission
but he can not upload new documents anymore, strange errors occured (error: 0 B space left )
in OKM_NODE_ROLE, there were values: 15 for ROLE_ADMIN and 3 for ROLE_USER for all the affected uuids

(added this after some hours of investigation:)
Figured out, that when I restricted ROLE_ADMIN (wich is NOT the users role) permission for all nodes recursively from 15 to 11 (or 3) it seems to be "fixed" => this indicates, that the WebDAV server did not deal the role of particular user correctly and treated common user as it was an admin.
After setting the ROLE_ADMIN permissions back to 15, all seems to be OK now, all users do have same WebDAV - privileges as in web-interface and as they supposed to.

Please can You answer me these questions - it can help me to determine more details in case it will happen again:

Can I set the log verbosity level being used by the WebDAV?
How can I determine the real applied Roles for the WebDAV session?
What can caused difference between permissions used by web-interface and WebDAV?
Can an inconsistency in the OKM_NODE_ROLE and/or other related tables be automaticaly fixed by the system, when all the node permissions for all Roles were changed?

thank You!

Re: WebDAV strange user permissions changes

PostPosted:Sat Oct 03, 2015 5:16 pm
by jllort
You should not propagate ROLE_USER or ROLE_ADMIN in your repository, these are for getting connection grants ( also ROLE_ADMIN for getting super user grants ).

Can you give us a screenshot with some document of folder with security tab shown. And we'll try to reproduce in our side.

Re: WebDAV strange user permissions changes

PostPosted:Mon Oct 05, 2015 10:19 am
by bouskam
hello,
thanks for replying and trying to help me, but Im affraid, that this problem cant be simply reproduced.
How the problem occured is unclear, and it disappered with the last step mentioned above (revoking ROLE_ADMIN recursively and setting it back again).

Basicaly - the issue is, that even if only ROLEs were applied without any user-dedicated permissions, suddenly one user has got other permissions than other user with same role.

This state should not normally occur - may be a database error or some OS related errors have caused it, but this is my guess only.
I found nothing in catalina.log - maybe a more verbose log may help with investigation...

here is how are the permissions looking (now with two more Roles to avoid use the ROLE_USER and ROLE_ADMIN)
Image


here is what the Log was saying (not much):

1. (the file was deleted, but should not):
2015-10-02 10:36:59,880 [http-bio-0.0.0.0-8080-exec-8] INFO com.bradmcevoy.http.HttpManager- DELETE :: http://192.168.98.26:8080/OpenKM/webdav/okm_root/zakazky/Q2015/Q997/Q997.pdf - http://192.168.98.26:8080/OpenKM/webdav/okm_root/zakazky/Q2015/Q997/Q997.pdf
2015-10-02 10:37:02,662 [http-bio-0.0.0.0-8080-exec-2] INFO com.bradmcevoy.http.HttpManager- PROPFIND :: http://192.168.98.26:8080/OpenKM/webdav/okm_root/zakazky/Q2015/Q997 - http://192.168.98.26:8080/OpenKM/webdav/okm_root/zakazky/Q2015/Q997


2. (other user account worked as expected):
2015-10-02 10:52:09,151 [http-bio-0.0.0.0-8080-exec-8] INFO com.bradmcevoy.http.HttpManager- DELETE :: http://192.168.98.26:8080/OpenKM/webdav/okm_root/zakazky/Q2015/Q1311/Q1311.doc - http://192.168.98.26:8080/OpenKM/webdav/okm_root/zakazky/Q2015/Q1311/Q1311.doc
2015-10-02 10:52:09,176 [http-bio-0.0.0.0-8080-exec-8] WARN com.bradmcevoy.http.StandardFilter- conflictException: Conflict exception: Q1311.doc
2015-10-02 10:52:09,212 [http-bio-0.0.0.0-8080-exec-10] INFO com.bradmcevoy.http.HttpManager- PROPFIND :: http://192.168.98.26:8080/OpenKM/webdav/okm_root/zakazky/Q2015/Q1311 - http://192.168.98.26:8080/OpenKM/webdav/okm_root/zakazky/Q2015/Q1311


and here is also the OKM_NODE_ROLE dump

Re: WebDAV strange user permissions changes

PostPosted:Tue Oct 06, 2015 6:04 pm
by jllort
There is a bug on roles table when removing roles ( if you remove several can cause really you are not removing what the table is showing to you ). I suggest upgrade to 6.3.1 ( download from here http://integration.openkm.com/ and here are the steps to upgrading http://wiki.openkm.com/index.php/Migrat ... 3_to_6.3.1 ).

Tell us if that solved the problem ?