🚫Remove Role Base Authentication

How to remove role-based authentication from all page.

Temporarily 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 menu.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/demo/data/menu.ts and remove the following import:

import { Role } from 'src/app/@theme/types/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/helpers/auth.guard.ts and delete this block:

Step 4: Modify menu-collapse.component.ts to Remove Role Filtering

Open src/app/@theme/layouts/menu/vertical-menu/menu-collapse/menu-collapse.component.ts

Before:

After:

Step 5: Remove Role-Based UI Restrictions

Modify menu-collapse.component.html

Remove the following attributes:

Modify menu-group.component.html

Delete lines 7 and 9:

Modify menu-item.component.html

Before:

After:

Step 6: Modify Login Page UI

Open src/app/demo/pages/auth/authentication-1/login/login.component.html and remove:

πŸ“Œ This removes the role selection UI.

Last updated