Custom Field Data Repopulation Issue in Role-Based Access System Configuration Dashboard

default discord avatar
.villainbehindglasses
8 months ago
4

Hello everyone, I'm currently developing a role-based access system that can be configured through a dashboard. I've added a custom field (as shown in the image) and successfully saved the data in JSON format to the database. However, I'm encountering an issue where the selected permissions for a particular role (in this case, the Editor role) are not repopulated when I check it again. Can someone please assist me with a solution to repopulating the data in the custom field? While I'm aware that I can use Axios or fetch to retrieve the data, I'm wondering if there's an alternative method available. Thank you.



UPDATE: I have resolved the problem. The updated value will be passed as a parameter to the 'useField' hook. I neglected to verify this initially, and it was my error

  • default discord avatar
    kris0x
    8 months ago

    wow nice work, do you have some url for this?

  • default discord avatar
    techinverted
    7 months ago

    @.villainbehindglasses how did you go about implementing this. Do you have a gist or repo of it?

  • default discord avatar
    .villainbehindglasses
    7 months ago

    I haven't created a repository yet as I'm still conducting some research and development. However, I have implemented a custom field that stores a JSON object in the database and created a function to check the permissions from the JSON and assign them to the collection's permission. I plan to convert this implementation into a plugin, (I hope I can). Once completed, I will share the plugin with all of you.

  • default discord avatar
    techinverted
    7 months ago

    Great stuff @.villainbehindglasses



    Do keep me updated and let me know if there is anything I can do to help

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.