Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/miagv/PlataformaEduca/llms.txt

Use this file to discover all available pages before exploring further.

PlataformaEduca uses role-based access control enforced at the Spring Security layer. Roles are stored in the roles table and linked to users through the usuario_roles join table. Every JWT token issued after login carries a roles claim that Spring Security reads on each request to decide whether to allow or reject it.

The five roles

RoleDescription
USERBase role. Limited access; not used for operational workflows.
ADMINSystem administration. Reserved for platform management.
COORDINADORAcademic coordinator. Manages scheduling and assignments.
DOCENTETeacher. Creates evaluations and records grades.
ESTUDIANTEStudent. Views their own courses and grades.
The three primary operational roles are COORDINADOR, DOCENTE, and ESTUDIANTE. Most API workflows involve one of these three roles.

Endpoint permissions

The table below shows which roles can access each endpoint group. A check in the “Any authenticated” column means the endpoint requires a valid token but does not restrict by role.
Endpoint groupPublicAny authenticatedCOORDINADORDOCENTEESTUDIANTE
POST /api/auth/**
GET/POST/PUT/DELETE /api/cursos/**
GET/POST /api/notas/**
GET/POST /api/coordinador/**
GET/POST /api/docente/**
GET /api/estudiante/**
The /api/auth/** endpoints (registration and login) are the only publicly accessible routes. All other endpoints require a valid JWT token in the Authorization: Bearer <token> header.

Role assignment at registration

Roles are set at registration time via POST /api/auth/register and cannot be changed through the API afterward. The role you supply in the registration request body determines which profile record is created automatically.
Role in requestProfile record created
DOCENTEA Docente record linked to the new Usuario
ESTUDIANTEAn Estudiante record linked to the new Usuario
COORDINADORA Coordinador record linked to the new Usuario
Attempting to change a user’s role after registration is not supported by the API. If the wrong role was assigned, the user account must be recreated.

Roles in the JWT token

After a successful login via POST /api/auth/login, the API returns a JWT token. The token’s payload includes a roles array containing the user’s role names prefixed with ROLE_:
{
  "sub": "teacher@school.edu",
  "roles": ["ROLE_DOCENTE"],
  "iat": 1716600000,
  "exp": 1716686400
}
Spring Security reads the roles claim on every request to enforce endpoint-level permissions. You do not need to pass the role separately — the token carries it.

401 vs 403 responses

StatusMeaningCommon cause
401 UnauthorizedToken is missing, expired, or invalidNo Authorization header; token has expired
403 ForbiddenToken is valid but the role is not permittedA DOCENTE token calling a COORDINADOR-only endpoint
If you receive a 403 and your token is valid, check that you are calling the correct endpoint for your role. Teacher workflows live under /api/docente/**, not /api/coordinador/**.

Build docs developers (and LLMs) love