Replies: 1 comment
-
If you have security concerns about access to certain parts of the data, it's best to define permissions and access rules directly in the schema rather than relying on hiding data in the UI. This ensures that restricted data remains protected even when users make direct API calls, not just through the user interface. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I was testing an application for accessing to unauthorized links and navigations.
user's role based routing
In the UI, to restrict the navigation links from being displayed in the application, I've wrapped it inside
HasRole
orHasRoles
depending upon the requirement like this:Doing this, the
user-list
page is not visible in the UI for theclient
andemployee
role, which is great.However, if I login to the app with other roles (
client
employee
accountant
) and directly set the route, eg:It will open the user-list page. I won't be able to perform
creation
deletion
ormodification
but canread
the data which is a serious security concern.To remove this, I tried implementing something to restrict the like this:
This seems to work
okay
I guess for the scope of the project with limited navigation links.However, I would like to know about how such cases are handled in contember the correct way. How is
ProtectedRoute
setup in contember based on theroles
of user.Also, in
production
environment, if I navigate to random links, for example,I get an error message that says
Fatal error
. I assume this error message is common for many different kinds of errors.I can't seem to find anywhere in app where this error page is located. In local development, we get error saying
No such page as asdfasdfs
.Could you clarify my confusion regarding the issues that I am facing. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions