fix(users): add manager to the valid-role whitelist
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
'manager' has been a fully-functional role throughout the app — notifications, operator assignment, dispute mediation — but was missing from both the user creation/update whitelist and the SSO auto-provisioning role list, so a manager account could never actually be created.
This commit is contained in:
@@ -202,7 +202,7 @@ def process_callback(db: Session, request_data: dict) -> User:
|
||||
)
|
||||
|
||||
# Validate role
|
||||
valid_roles = {"admin", "red_lead", "blue_lead", "red_tech", "blue_tech", "viewer"}
|
||||
valid_roles = {"admin", "red_lead", "blue_lead", "red_tech", "blue_tech", "manager", "viewer"}
|
||||
if role not in valid_roles:
|
||||
log.warning("SSO: unknown role '%s' for user '%s', falling back to default", role, username)
|
||||
role = cfg.default_role or "viewer"
|
||||
|
||||
@@ -26,8 +26,8 @@ from app.domain.errors import (
|
||||
# Import User from app.models.user
|
||||
from app.models.user import User
|
||||
|
||||
# Assign VALID_ROLES = {"admin", "red_tech", "blue_tech", "red_lead", "blue_lead", "viewer"}
|
||||
VALID_ROLES = {"admin", "red_tech", "blue_tech", "red_lead", "blue_lead", "viewer"}
|
||||
# Assign VALID_ROLES = {"admin", "red_tech", "blue_tech", "red_lead", "blue_lead", "manager", "viewer"}
|
||||
VALID_ROLES = {"admin", "red_tech", "blue_tech", "red_lead", "blue_lead", "manager", "viewer"}
|
||||
|
||||
|
||||
# Define function list_users
|
||||
|
||||
Reference in New Issue
Block a user