🔒 Closed User's role restriction in React JS

Status
Not open for further replies.

Zyzz

Forum Guru
What is better in terms of handling user's role (Admin, Superadmin, User) restriction in Single Page Application (SPA) like React JS?

Option 1: All users will be redirected to a single route and hide the restricted component(s) based on their user's role.

Option 2: Each user will be redirected to a designated route based on their user's role.

Why your chosen option is better than another?

If you have any option(s) or suggestion(s) feel free to share. 🙂
 
Option 1 will only be a better choice if all Roles almost share the same UI with some minimal features hidden and is not available from a User role perspective; otherwise option 2 should be used if you have something like Dashboard and Analytics page with subroutes that only superadmin / admin are authorized to see and operate.
 
really dependent sa content ng app mo.

Option 1 and 2 are both great.

Gaya ng sabi ng dalawang lods, options1 ( most common approach ) . Hide na lng ng ibang fields etc.

Sa ibang requirement kse, dapat may sariling admin page, iba yung itsura (if more on adding content sa actual view ng normal user ).
 
Status
Not open for further replies.

About this Thread

  • 3
    Replies
  • 553
    Views
  • 4
    Participants
Last reply from:
zeinab01

Trending Topics

Online now

Members online
1,077
Guests online
3,658
Total visitors
4,735

Forum statistics

Threads
2,306,633
Posts
29,173,142
Members
1,193,961
Latest member
Antagonist123
Back
Top