User Story #666
openFeature #664: My Profile
Frontend - Role Management - Display User Role and Restrict User Access Based on Assigned Role
0%
Description
As a platform user,
I want to see only the features that belong to my role,
So that I can easily perform my responsibilities without seeing features that I am not authorized to access.
Business Background¶
The platform supports four user roles:
- Customer
- Partner (B2B Travel Agent)
- Supplier
- Super Admin
Each role has different permissions and should have a different user experience throughout the application.
The interface should automatically adapt based on the logged-in user's assigned role.
Functional Requirements¶
1. Role-Based Home Screen¶
After successful login, the user shall be directed to the appropriate home page according to their assigned role.
| User Role | Landing Page |
|---|---|
| Customer | Customer Dashboard |
| Partner | Partner Dashboard |
| Supplier | Supplier Dashboard (Future Phase) |
| Super Admin | Admin Dashboard |
2. Navigation Menu¶
The navigation menu shall display only the features available to the logged-in user's role.
The user shall never see menu items that they are not authorized to access.
Example
Customer should see
- Home
- Packages
- Flights
- Wishlist
- My Quotes
- My Bookings
- My Profile
Customer should NOT see
- Package Management
- User Management
- Partner Management
- Supplier Management
- Reports
- Platform Settings
Partner should additionally see
- B2B Pricing
- Partner Dashboard
- Partner Quotes
Super Admin shall see
- Dashboard
- Packages
- Flights
- Customers
- Partners
- Suppliers
- Reports
- Settings
- User Management
- Activity Logs
3. Display Logged-in Role¶
The user's current role shall be visible inside the profile section.
Example
Role
Customer
or
Partner
or
Supplier
or
Super Admin
4. Restricted Menu Items¶
Menu items that the user is not authorized to access shall not be displayed.
The application shall never display disabled menu items for restricted features.
5. Direct URL Access¶
If the user manually enters the URL of a restricted page,
The page shall not open.
Display
You do not have permission to access this page.
Provide a button
Return to Dashboard
6. Unknown Role¶
If the application cannot determine the user's role,
Display
We're unable to determine your account permissions. Please sign in again.
Provide button
Go to Login
7. Session Role Change¶
If the user's role changes while they are signed in,
The application shall notify the user.
Display
Your account permissions have changed. Please sign in again to continue.
After acknowledgement,
Return the user to the Login page.
8. Loading State¶
While permissions are being loaded,
Display
- Loading indicator
- No navigation menu
- No page content
The user shall not briefly see unauthorized menus.
Validation Rules¶
No manual validation is required.
The application shall always rely on the assigned user role.
User Messages¶
Unauthorized Access¶
You do not have permission to access this page.
Unknown Role¶
We're unable to determine your account permissions. Please sign in again.
Permission Changed¶
Your account permissions have changed. Please sign in again to continue.
Acceptance Criteria¶
Scenario 1¶
Given a Customer logs in
When the dashboard opens
Then only Customer menus shall be visible.
Scenario 2¶
Given a Partner logs in
When navigation loads
Then B2B features shall be visible.
Scenario 3¶
Given a Customer manually enters an Admin URL
When the page loads
Then the page shall not open.
Display
You do not have permission to access this page.
Scenario 4¶
Given the user's role cannot be identified
When the application loads
Then
Display
We're unable to determine your account permissions. Please sign in again.
In Scope¶
- Role-based navigation
- Role-based landing pages
- Unauthorized page handling
- Display current role
- Permission refresh
Out of Scope¶
- Creating new roles
- Editing permissions
- Assigning users to roles
- Staff administration
Updated by Islam Mansoori about 1 month ago
- Subject changed from Role Management to Frontend - Role Management - Display User Role and Restrict User Access Based on Assigned Role
- Description updated (diff)