-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
When loading permissions at login, the admin portal only uses the first role returned by DHService (roles[0]). If a member has multiple roles assigned (e.g. both Authorizer and Board), only the first role's permissions are applied — the others are silently ignored.
Affected Code
code/DHAdminPortal/app.py — in the index() route:
role_info = roles_data["roles"][0] # Get first role
session["user_role"] = role_info.get("role_name", "Unknown")
session["user_permissions"] = role_info.get("permission", {})Question
Should we:
- Merge permissions — union the
viewandchangearrays across all assigned roles, giving the member the combined permissions of all their roles? - Use highest privilege — pick the role with the broadest permissions?
- Leave as-is — keep single-role behavior and document that members should only have one admin role assigned?
Context
Currently only three roles exist (Authorizer, Administrator, Board) and it's unclear whether members are expected to hold multiple roles simultaneously. If they are, option 1 (merge) is the most intuitive behavior. If not, the code should validate and warn when multiple roles are found.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Backlog