rafoli / liferay-sample-workspace

2 stars 7 forks source link

INLSW-38 Restrict views or tabs (React). #71

Closed rennanprysthon closed 3 years ago

rennanprysthon commented 3 years ago

Create two values on SampleWorkspace javascript global variable: isAdmin and isUser. Based on user roles, the program will show the add button in React Sample Module.

In react module, I've created a UserRolesContext to share this information to all components, using the useRoles() hook.

This hook returns these values: isSignedIn, isAdmin, and isUser.