I have a an object as bellow for user ACl(Access Control list):
{
'api/modelA': ['GET', 'POST'],
'api/modelB': ['GET'],
/*...*/
'api/modelZ' : ['GET']
}
So after user is authenticated I get the ACLs from server.
How can I find a solution for rendering all the components based on these ACls. for instance if user doesn't have access to edit a post the EditButtom component should not be rendered.
Note: for some cases a component will have a different style like gray color if there is no access for the user.