Hi
I had a website with strapi v3 in the back-end. Now I want to create an Editor role for it.
the problem is when I do that from “Settngs” >> “roles” >> “editors”
I could not edit any fields.
Also I could not “Define conditions” when I click on settings of each part:
The role editing feature isn’t yet available in the community edition of version 3.
However, since it is now available in newer strapi versions, you could update to a newer version or do a hacky workaround:
Connect to your sqllite db
Open the admin_roles table
Add a row with the required role information and save the changes.
Open the Roles section in the Strapi frontend (Settings > Adminstration Panel > Roles)
To make it easier to change permissions for the newly created rule, execute this line in your browser console (F11) document.querySelectorAll('input[disabled]').forEach(i => i.removeAttribute('disabled')); This will remove the disabled attribute from all checkboxes so that you can actually toggle the permissions.
In version 3 you also need to reset the cursor: document.querySelectorAll('input[disabled]').forEach(i => i.style.cursor = 'inherit');.
Even with this little hack, there is no guarantee that you will be able to set your permissions as you wish. But you can give it a try.
Thanks for your answer, but unfortunately that was not working for me!
First of all, I could not understand your meaning by “connect to your sqlite db”!
Is it something about source codes of Strapi or it is in the Strapi front-end (dashboard)?
Also, the codes you said does not work in browser console. Did you test them in your own?
Strapi stores alpha-numeric informations like text, numbers, relations but also settings for the strapi frontend in a database. When you first configured your strapi instance, you had to create and configure a database and a user to access it. If you are using a sqlite database you can use tools like sqlite browser or simular to connect to your database, see and modify the content. But make sure you have a backup and you know what values you can change.
If you start with a new project, it’s highly recommanded to use the newest version (v5 at the moment).
Otherwise you could upgrade to a newer version, where the role management is generally available to all users.
If you enable the checkboxes in your admin panel (browser console) make sure the checkboxes you want to change are visible. Then run the two commands and you should be able to modify the checkboxes and save the changes.
I have a question again about your last guide. How could I do that? As you can see in my first image in this question, in “Define conditions” part, the checkboxes are in a dropdown menu. So when I click on browser console to run the command you guide me, the dropdown closed and the checkboxes become hidden again!