Role Access Validator
API Contract
REST
/api/v1/stats-access
3 endpoints
GET
/api/v1/stats-access/api/v1/stats-access/scope
Get the stats access scope for the currently authenticated user
Public
Response Example
{
"level": "coordinator",
"org_id": "org_university_west",
"coordinator_id": "coord_4f8a21",
"can_view_org_wide": false,
"can_view_all_mentors": true,
"allowed_coordinator_ids": [
"coord_4f8a21"
]
}
GET
/api/v1/stats-access/api/v1/stats-access/validate/:coordinator_id
Check whether the current user may access stats for a specific coordinator's roster
Public
Response Example
{
"requesting_user_id": "user_88d3bc",
"target_coordinator_id": "coord_4f8a21",
"access_granted": true,
"scope": {
"level": "coordinator",
"org_id": "org_university_west",
"coordinator_id": "coord_4f8a21"
},
"reason": "User is the coordinator for this roster"
}
GET
/api/v1/stats-access/api/v1/stats-access
List all access scope records (admin only)
Public
Response Example
{
"data": [
{
"user_id": "user_88d3bc",
"display_name": "Maria Chen",
"level": "coordinator",
"org_id": "org_university_west",
"coordinator_id": "coord_4f8a21"
},
{
"user_id": "user_12ab77",
"display_name": "Dr. Simone Reyes",
"level": "admin",
"org_id": "org_university_west",
"coordinator_id": null
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 7
}
}