Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement role-based authentication in admin dashboard 🔒 #426

Merged
merged 24 commits into from
Jul 31, 2024

Conversation

ramiAbdou
Copy link
Member

@ramiAbdou ramiAbdou commented Jul 31, 2024

Description ✏️

This PR does the following:

  • Instead of just checking for the presence of a user_id in the session, we'll actually query the database to ensure that the user is authenticated.
  • Adds a role column for admins, and scraps the old is_ambassador column.
  • Remove the allowAmbassador option for routes and instead use minimumRole.
  • Combines the admin module into admin.core, admin.types and admin.ui.
  • Protects the feature flags and Bull routes to owner.
  • Adds the useAdminRole hook.

It also sneaks in a couple unrelated changes:

  • Removes scroll from the Table component, which fixes a bug with the menu button of a table row that was scrolled.
  • Deprecates the iife function in favor of the run function (same implementation, just different name).
  • Adds the Dashboard.Header component.
  • Adds a fail and success function to begin standardizing core function responses.
  • Adds a custom SelectExpression to force database columns to use the table names with columns.

Type of Change 🐞

  • Feature - A non-breaking change which adds functionality.
  • Fix - A non-breaking change which fixes an issue.
  • Refactor - A change that neither fixes a bug nor adds a feature.
  • Documentation - A change only to in-code or markdown documentation.
  • Tests - A change that adds missing unit/integration tests.
  • Chore - A change that is likely none of the above.

Checklist ✅

  • I have done a self-review of my code.
  • I have manually tested my code (if applicable).
  • I have added/updated any relevant documentation (if applicable).

@ramiAbdou ramiAbdou self-assigned this Jul 31, 2024
@ramiAbdou ramiAbdou marked this pull request as ready for review July 31, 2024 23:36
@ramiAbdou ramiAbdou merged commit 86bcf8e into main Jul 31, 2024
1 check passed
@ramiAbdou ramiAbdou deleted the rami/admins branch July 31, 2024 23:37
@wflore19
Copy link
Contributor

wflore19 commented Aug 1, 2024

@ramiAbdou man your pr's are a breath of fresh air

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.

2 participants