Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

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

default discord avatar
.villainbehindglasses2 years 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
    kris0x2 years ago

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

  • default discord avatar
    techinverted2 years ago
    @273835182979678221

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

  • default discord avatar
    .villainbehindglasses2 years 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
    techinverted2 years ago

    Great stuff

    @273835182979678221

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

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.