Skip to content

Feature/new guard - #1

Open
NayanthaRC wants to merge 11 commits into
feature/tim-ad-exchangefrom
feature/new-guard
Open

NayanthaRC wants to merge 11 commits into
feature/tim-ad-exchangefrom
feature/new-guard

Conversation

@NayanthaRC

Copy link
Copy Markdown
Contributor

This pull request introduces role-based dashboards and authentication guards for "Administrator", "Model Trainer", and "Super Admin" roles in the Global Classifier application. It adds backend endpoints and frontend pages for each dashboard, implements role-based routing and access control, and defines the necessary role constants and environment variables.

Key changes:

Backend: Role-based dashboards and guards

  • Added new endpoints and authentication guards for /admin/dashboard, /model-trainer/dashboard, and /super-admin/dashboard, each with its own guard logic and authority check templates. These endpoints return role-specific dashboard data. [1] [2] [3] [4] [5] [6] [7] [8]
  • Introduced a public test endpoint for checking current user info via JWT.
  • Updated .env.example to include a mapping for the ROLE_SUPER_ADMIN.

Frontend: Dashboard pages and routing

  • Added new React pages and SCSS styles for AdminDashboard, ModelTrainerDashboard, and SuperAdminDashboard, each displaying user info and permissions relevant to the role. [1] [2] [3]
  • Updated App.tsx to import these dashboards, define role constants, and add role-based routes that render the appropriate dashboard or an unauthorized message based on user authorities. [1] [2] [3]
  • Added an export for the new AdminDashboard component.

These changes collectively provide a foundation for secure, role-specific access and user experience in the application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant