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

Before:

data: { roles: [Role.Admin, Role.User] }

After:

data: { roles: [Role.Admin] }
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:

import { Role } from './theme/shared/_helpers/role';

Step 2: Remove Role-Based Data Restrictions

Find and remove:

Step 3: Modify auth.guard.ts to Remove Authorization Check

Open src/app/theme/shared/_helpers/auth.guard.ts and delete this block:

Step 4: Modify nav-content.component.ts to Remove Role Filtering

Open src/app/theme/layout/admin/navigation/nav-content/nav-content.component.ts and remove the content below.

Step 5: Remove Role-Based UI Restrictions

Modify nav-collapse.component.html

Remove the following attributes:

Modify nav-group.component.html

Delete the below code at lines 7 and 9:

Modify nav-item.component.html

Before:

After:

Step 6: Modify Login Page UI

Open src/app/demo/pages/authentication/authentication/auth-signin-v2/auth-signin-v2.component.html and remove:

πŸ“Œ This removes the role selection UI.