Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cache Viewer page is accessible only to users with manage_options capability (unfiltered) #110

Closed
chesio opened this issue Apr 19, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@chesio
Copy link
Owner

chesio commented Apr 19, 2024

However link to the page in dashboard widget is rendered whenever this call returns true:

apply_filters(Hooks::FILTER_USER_CAN_FLUSH_CACHE, current_user_can('manage_options'))

Let's tackle it as part of 3.4, it might be not straight-forward to fix.

@chesio chesio added the bug Something isn't working label Apr 19, 2024
@chesio chesio added this to the 3.4.x milestone Apr 19, 2024
@chesio chesio self-assigned this Apr 19, 2024
@chesio
Copy link
Owner Author

chesio commented Apr 22, 2024

Let's tackle it as part of 3.4, it might be not straight-forward to fix.

It's actually straight-forward to fix. Only users with manage_options capability can access Cache Viewer, this has always been the case and it is documented this way as well. However, any user can flush the cache in case corresponding filter is set accordingly. So the issue is only about display of link to Cache Viewer in dashboard: if user can flush the cache, but does not have manage_options capability, there should be no link (only plain text).

@chesio chesio modified the milestones: 3.4.x, 3.3.x Apr 22, 2024
@chesio chesio closed this as completed in 28e3a7a Apr 22, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant