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

Add Role Assignment with Standardized Dropdown #79

Open
awesominat opened this issue Jan 11, 2025 · 2 comments
Open

Add Role Assignment with Standardized Dropdown #79

awesominat opened this issue Jan 11, 2025 · 2 comments

Comments

@awesominat
Copy link
Contributor

Assign roles to users:

Via drop-down on /admin/roleassignment, admins should be able to give users a new role (VP Infra, Web Deb, etc).

The different roles should be grabbed from Firestore (either by mocking it or using Firestore). The idea for it being a dropdown is to ensure uniformity and help prevent duplicate roles.

There should also be a way to add new roles, that also interacts with Firestore.

UI here isn't too relevant as this is mainly for site maintainers.

@YeIIcw YeIIcw changed the title Allow assigning roles Add Role Assignment with Standardized Dropdown (Only VPs Can Create New Roles) Jan 18, 2025
@YeIIcw
Copy link

YeIIcw commented Jan 18, 2025

Description
We need a system where users can have different roles assigned for different years, ensuring accurate historical tracking of contributions. For example, a user might have been a "Member" in 2023 and a "Team Lead" in 2024. Roles should be selected from a standardized dropdown list, and only VPs can add new roles to the system.

Each user will have a yearList field in the schema that maps years to the assigned roles as yearList[year: [roles]].


User Story
As an admin (specifically a VP), I want to:

  1. Assign roles to users for specific years using a standardized dropdown list.
  2. Allow users to have different roles in different years, tracked via a yearList field.
  3. Ensure only VPs can add new roles to maintain consistency across the system.

Acceptance Criteria

  1. Yearly Role Assignments

    • Introduce a yearList field in the user schema that maps years to roles as yearList[2024: [roleList]].
    • Allow multiple roles for a single user within a given year.
  2. Standardized Roles

    • Implement a dropdown menu containing a predefined list of roles (e.g., “Member,” “Team Lead,” “VP,” etc.).
    • Prevent manual entry of roles unless the user is a VP.
  3. Add New Role Button

    • Include an “Add New Role” button, visible only to VPs, for creating new roles.
    • Newly created roles should immediately be available in the dropdown.
  4. UI/UX

    • Allow admins to view and manage roles per year for each user.
    • Provide clear labels and guidance (e.g., “Assign Roles for 2024” or “Add Role to Year”).
  5. Testing

    • Unit Tests: Confirm that yearly role assignments, dropdown functionality, and new role creation work as expected.
    • Integration Tests: Verify that only VPs can create new roles and that they appear properly in the dropdown.
    • Manual QA: Check the UI for correctness when assigning roles for multiple years to a single user.

Additional Notes

  • Ensure that roles are validated for duplicates or near-duplicates to prevent confusion.
  • Historical role assignments must not be editable by unauthorized roles or users.
  • Future extensions might include filtering or sorting users based on their yearly roles.

@YeIIcw YeIIcw changed the title Add Role Assignment with Standardized Dropdown (Only VPs Can Create New Roles) Add Role Assignment with Standardized Dropdown Jan 18, 2025
@YeIIcw
Copy link

YeIIcw commented Jan 18, 2025

check shadcn for dropdown components

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

No branches or pull requests

2 participants