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

Modify user viewability of CDN Tools #7684

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

csebianlander
Copy link
Contributor

This PR modifies the conditions for the "CDN Tools" sidebar option so that it is only visible for users with the v1.add_cdnhistory permission.


Changes

  • Changing return conditions for IfCDNEnabledMenuItem to check user permissions

How to test this PR

Because cdn_is_configured() will always fail on local, you can test that the rest of the conditional is working properly by removing that section of wagtail_hooks.py and then testing by logging in as a user who has the permission (e.g. admin) and a new or existing user who does not (e.g. any user within the Edit-only group).

@csebianlander csebianlander self-assigned this Apr 24, 2023
@chosak
Copy link
Member

chosak commented May 18, 2023

@csebianlander finally coming around to this. If we want to remove the ability of users to even access the CDN view unless they have permission to trigger a cache clear, there's a little more code we can remove, for example. May I push a commit to this PR that does a bit more cleanup?

@csebianlander
Copy link
Contributor Author

@chosak no idea why/how I left this sitting so long without responding to you. You are welcome to push more code to the PR, though obviously it's not the highest priority!

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

Successfully merging this pull request may close these issues.

None yet

2 participants