Skip to main content

EPIC-2: Identity, Authentication & Role-Based Access Control

FieldValue
Total Story Points89 SP
Stories10
SprintsSprint 3-8 (Weeks 5-16)
PriorityP0 - Critical Foundation
DependenciesEPIC-1 (Infrastructure)

Overview

Identity and access control is the security foundation of EduPulse. With 500K+ users across multiple schools, we need:

  • Multi-tenant isolation: Schools cannot see each other's data
  • Role-based access: Principal, Teacher, Student, Parent have different permissions
  • Fine-grained control: Teachers only see their classes, parents only see their children
  • DPDPA Compliance: Consent management + audit trails
  • Scalability: Custom roles and permissions per school

RBAC Model

Permission Format: {module}.{resource}.{action}

Examples:
- student.profile.read (View student profiles)
- fee.invoice.create (Create invoices)
- admin.role.manage (Manage roles)

Wildcards:
- student.* (All student permissions)
- *.*.read (Read-only everywhere)

Data Scopes

ScopeDescriptionExample
SELFUser's own data onlyStudent viewing own grades
CHILDRENParent's children onlyParent viewing child's fees
ASSIGNED_CLASSESTeacher's classesClass teacher viewing students
DEPARTMENTDepartment staffHOD viewing teachers
ALL_SCHOOLEveryone in schoolPrincipal, Admin

Stories Summary

StoryTitleSPSprint
2.1AWS Cognito Multi-tenant Setup8Sprint 3
2.2Authentication Service & JWT8Sprint 3-4
2.3Core RBAC Engine13Sprint 4-5
2.4Permission Definitions & Seeding8Sprint 5
2.5Custom Roles per School8Sprint 5-6
2.6Data-Level Access Control13Sprint 6-7
2.7Consent Management (DPDPA)8Sprint 7
2.8Security Audit Logging8Sprint 7-8
2.9Encryption & Data Protection8Sprint 8
2.10Role Management Admin UI7Sprint 8

System Roles Hierarchy

SUPER_ADMIN (Platform)
└── SCHOOL_ADMIN (IT Admin)
├── PRINCIPAL
│ ├── VICE_PRINCIPAL
│ │ ├── HOD
│ │ ├── CLASS_TEACHER
│ │ └── TEACHER
│ └── ACCOUNTANT
├── STUDENT
└── PARENT

Technical Stack

ComponentTechnology
Auth ProviderAWS Cognito
RBAC EngineGo (high performance)
Auth ServiceNode.js/NestJS
Permission CacheRedis
DatabasePostgreSQL (RLS)
EncryptionAWS KMS + AES-256-GCM