equal-aqua
equal-aqua9mo ago

Fecth user role from strapi

How to fetch the user role from strapi?
2 Replies
kapa.ai
kapa.ai9mo ago
Hi @Sly. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To fetch user roles from Strapi in a refine application, you need to create a user in the Strapi app and set the value of its role field to Authenticated. This can be done by logging in to the Strapi dashboard and navigating to the Content Manager >> Users section. Here is an example of how to create a user:
email: demo@refine.dev
password: demodemo
email: demo@refine.dev
password: demodemo
After creating the user, set the value of its role field to Authenticated. You only want your app users to access the CRUD actions when Authenticated. So, set the appropriate permissions from Settings >> USERS & PERMISSIONS >> Roles. For more details, you can refer to the Strapi quickstart guide (https://docs.strapi.io/dev-docs/quick-start#step-3-set-roles--permissions). Please note that you need to set up permissions for each of your resources. Once these steps are completed, you can start adding resources to your refine app. For more information, you can refer to this source (https://refine.dev/blog/refine-react-invoice-generator-2#setting-up-app-roles-for-strapi). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai9mo ago
<@1172098337760096258> kapa.ai is still learning and improving, please let us know how it did by reacting below