Description
Add a guard (following the pattern of backend/src/roles/roles.guard.ts) that only allows users with an admin/staff role to access sensitive analytics endpoints (churn-risk, exports, raw event listing).
Why this matters
Analytics data can reveal individual user behavior; not all endpoints should be reachable by regular authenticated users.
Files to touch
backend/src/analytics/guards/analytics-admin.guard.ts
backend/src/roles/roles.decorator.ts
Acceptance Criteria
Notes
This issue is part of the new analytics module effort (tracking, aggregation,
and reporting on player/game activity). Please keep new code inside
backend/src/analytics/ following the same module/controller/service/provider
layout used by existing modules (e.g. progress, streak, quests).
Description
Add a guard (following the pattern of
backend/src/roles/roles.guard.ts) that only allows users with an admin/staff role to access sensitive analytics endpoints (churn-risk, exports, raw event listing).Why this matters
Analytics data can reveal individual user behavior; not all endpoints should be reachable by regular authenticated users.
Files to touch
backend/src/analytics/guards/analytics-admin.guard.tsbackend/src/roles/roles.decorator.tsAcceptance Criteria
Notes
This issue is part of the new
analyticsmodule effort (tracking, aggregation,and reporting on player/game activity). Please keep new code inside
backend/src/analytics/following the same module/controller/service/providerlayout used by existing modules (e.g.
progress,streak,quests).