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

Changes in can edit permissions only take effect after user has logged out #444

Open
emteknetnz opened this issue May 3, 2021 · 4 comments

Comments

@emteknetnz
Copy link
Member

emteknetnz commented May 3, 2021

CMS 4.8.0-beta1

I created a group "my group" who have access to the file section, but not 'can edit any file'

I added a member to this group "my user"

I create a file with the the following permission
Who can view this file? Only these groups (choose from list): "my group"
Who can edit this file? Only these groups (choose from list): "my group"

However the 'my user' was unable to edit the file - they were read only

@emteknetnz emteknetnz changed the title Adding edit permissions to restricted file Adding edit permissions to restricted file does not seem to work May 3, 2021
@brynwhyman
Copy link

@emteknetnz can you please confirm what the permission settings are for the file's folder (and any parent folders also)?

I can't recreate this with the following set up:

  • I created a group "my group" who have access to the file section, but not 'can edit any file'
  • I added a member to this group "tester"

Root folder
-> 'folder 1' (view permissions: logged in users; edit permissions: logged in users)
--> 'file 1' (view permissions: 'my group'; edit permissions: 'my group')

See:
Permissions:
image

Able to edit:
image

@emteknetnz
Copy link
Member Author

emteknetnz commented May 4, 2021

Ah OK I see what's happening. It does work as expected, however persmissions seems to be tied to the session.

You should be able to replicate if you are logged in as an admin on one browser and logged in as a different user in another browser.

If the admin browser, restricts the canEdit permissions on a new file, then user in the other browser can still edit the file. However if that user logs out and logs back in, then they won't be able edit the file.

I'll update the issue title

@emteknetnz emteknetnz changed the title Adding edit permissions to restricted file does not seem to work Changes in can edit permissions only take effect after user has logged out May 4, 2021
@maxime-rainville
Copy link
Contributor

Permission for files are cached because it's an expensive call to make. That might be part of the problem we are seeing here.

I'm not sure I would fuss about this too much as long as the TTL for that cache doesn't go on forever.

@michalkleiner
Copy link
Contributor

Would it be possible to tie this together somehow with the session manager module and if installed, invalidate all user sessions that could/should be affected by the permission change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants