Reacting to permission changes in admin panel #3660
joas8211
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd want to see improvement towards reacting to permission changes in admin panel. I've had already a couple of cases where this has become a problem, but there's no perfect way to fix it without making changes to Payload's core.
I worked around the problem using
refreshPermissions
function from useAuth React hook by extending the edit view. Due to changes in Payload 2.0 that seems to be really hard to do now. Instead of extending edit view, I can add UI field that does the same trick after form has been submitted. I can also add an effect on list view that triggers permission refresh every time the list changes to take account deletion and bulk operations, but that causes extra requests when opening the list and browsing.There's few options that could make this better:
I can implement this in Payload by submitting a PR if we come into conclusion for how do we do it, if this is something the team wants to be a core feature.
Related links:
Beta Was this translation helpful? Give feedback.
All reactions