Hello,
User A has a folder shared to some other users, we use User B as an example. User B has edit permission on this shared folder and User B created a subfolder with an file. Now User A wants to publish a new version of this file, but got the following error:
Can't publish draft
The server reports that you don't have the access to perform this operation.
I tried to reproduce this with a test account on a fresh folder, but it works. So I had a look at the database to find out what's wrong:
SELECT ROLE, u.NAME
FROM USER_TO_COLLECTION_ROLE utcr
LEFT JOIN files."USER" u ON (u.ID = UTCR.USER_ID)
WHERE hex(utcr.COLLECTION_ID) = (
SELECT hex(id)
FROM files."COLLECTION"
WHERE LABEL = '<Name of the shared first level folder>'
)
This was a bit hard because of the binary PKs, which I never saw before. But I learned that ROLE = 2 is for editors and 3 for owners. If the directory contains subfolders, this changes to ROLE = 3 for editors and 4 for owners.
Those permissions are correctly set, for my test folder as well as the users folder where the issue occurs: User A has ROLE = 3 and User B ROLE = 3 since the shared folder contains other folders. It seems that those permissions works at least partly, since the affected user can see the folders and files in the Explorer. But not when publishing.
What is the cause of this strange behavior and how can we fix it?