Remove Role Base Authentication
How to remove role-based authentication from all page.
Temporary Disable Role-Based Authentication
To temporarily disable authentication, modify the role-based access in the following files.
Step 1: Update app-routing.module.ts
and navigation.ts
app-routing.module.ts
and navigation.ts
Before:
After:
This ensures that all users are treated as Admin
, bypassing role-based restrictions.
Remove Role Base Authentication Permanent
To remove authentication permanently, follow these steps.
Step 1: Remove Role Import
Open src/app/app-routing.module.ts
and src/app/theme/layout/admin/navigation/navigation.ts
and remove the following import:
Step 2: Remove Role-Based Data Restrictions
Find and remove:
Step 3: Modify auth.guard.ts
to Remove Authorization Check
auth.guard.ts
to Remove Authorization CheckOpen src/app/theme/shared/_helpers/auth.guard.ts
and delete this block:
Step 4: Modify nav-content.component.ts
to Remove Role Filtering
nav-content.component.ts
to Remove Role FilteringOpen src/app/theme/layout/admin/navigation/nav-content/nav-content.component.ts
and remove the code below.
Step 5: Remove Role-Based UI Restrictions
Modify nav-collapse.component.html
Remove the following attributes:
Modify nav-group.component.html
Delete lines 7 and 9:
Modify nav-item.component.html
Before:
After:
This removes tooltips and disables restrictions on menu items.
Step 6: Modify Login Page UI
Open src/app/demo/pages/authentication/authentication-v1/v1-login/v1-login.component.html
and remove:
📌 This removes the role selection UI.
Last updated
Was this helpful?