How to define all allowed actions for API endpoints?

I have set up my testing environment with jest and supertest and I get forbidden error whenever I make an api request with 403 Forbidden. After doing some research I found that this occurs because I’ve not set the permissions for the api endpoint. However even if I define all allowed actions for API endpoints, it does not work in the test environment and I have found that strapi creates a new instance whenever I run the tests which it destroys after. And This implies that whenever I create an instance in the test environment, I should create new admins, and other users and the same applies to the permissions in the allowed actions for api endpoints under the roles authenticated and public. I’ve made research on how to configure these in the test environment but nothing seems to be working. When I query the permissions. It only shows the permissions that come with the default strapi without allowed actions for api endpoints. I really need to conceptualize this and find a way to around. I’m grateful for any help. Thankyou.

This topic has been created from a Discord post (1261347018824089662) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

Use config sync plugin

There is a service to inject config directly

I finally solved it using the user-permissions role service.
Iterated through the permissions while updating the permissions for each api

Thanks for your help.