Security reference says standard users cannot read any data and unannotated routes default to admin-only
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- authorization, documentation
Línea de trabajo
Lee docs/en/5-reference/5.1-security.md junto con apps/api/src/auth/ability.factory.ts y apps/api/src/auth/guards/jwt-auth.guard.ts para verificar los permisos de los roles y el comportamiento cuando falta una ruta. Actualiza el acceso indicado para Standard User y explica que una ruta sin @RouteAccess falla con un 500; confirma que el texto también refleje la nota sobre la regla de lint del payload. La tarea estará terminada cuando la referencia coincida con esas fuentes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The Security reference misstates what the Standard User role can read and what happens to a route with no @RouteAccess. It says standard users "are not able to access any data" and "are only allowed to administer instruments". AbilityFactory gives the STANDARD role read Subject and read Session in their groups, and read Group too. So a standard user can list every subject in their groups, including the stored names, dates of birth and sex (GET /v1/subjects), and every session there with its subject embedded (GET /v1/sessions). For a route with no route access defined, the page also says "the default is manage and all", so only an admin may call it. JwtAuthGuard instead logs an error and throws a 500 for every caller, including admins. An admin deciding which role to give a research assistant uses this page to judge exposure. As written, it understates what the default role can see.
Where
docs/en/5-reference/5.1-security.md:28, :38 and :50-52:
... If there is no route access explicitly defined for a given route, the default is `manage` and `all`.
...
... If a route does not have any required permission set specified, the user must have permission to manage all resources to have access (i.e., the platform admin). ...
...
#### Standard User
By default, standard users are not able to access any data. They are only allowed to administer instruments, and download the record once complete (as it is stored in memory at that time).
apps/api/src/auth/ability.factory.ts:78-88:
case 'STANDARD':
ability.can('read', 'Group', { id: { in: groupIds } });
ability.can('read', 'Instrument');
ability.can('create', 'InstrumentRecord');
ability.can('create', 'InstrumentRecordFile', { groupId: { in: groupIds } });
ability.can('read', 'Session', { groupId: { in: groupIds } });
ability.can('create', 'Session');
ability.can('create', 'Subject');
ability.can('read', 'Subject', { groupIds: { hasSome: groupIds } });
ability.can('read', 'User', { id: payload.id });
apps/api/src/auth/guards/jwt-auth.guard.ts:31-34:
if (!routeAccess) {
this.loggingService.error(`Route access is not defined for url: ${request.url}`);
throw new InternalServerErrorException();
}
Reproduce
- Create a user with the Standard User role in a group that has subjects identified by personal information.
- Sign in as that user and call
GET /v1/subjects?groupId=<group>andGET /v1/sessions?groupId=<group>.
Actual: both return the group's subjects (with firstName, lastName, dateOfBirth, sex) and its sessions.
Expected (per the page): no data is returned.
Tests
docs/ has no test runner (docs/AGENTS.md). Review the corrected text against ability.factory.ts and jwt-auth.guard.ts.
Suggested fix
Rewrite "Standard User" to list what the role holds: it can create subjects, sessions and records, and it can read the subjects, sessions and group of its own groups, but not instrument records. Replace both "default is manage all" sentences with what the guard does: a route without @RouteAccess fails with 500 for everyone, and eslint (REQUIRE_ROUTE_ACCESS) refuses such a route at lint time.
- Lenguaje dominante
- TypeScript
- Estrellas
- 119
- Forks
- 19
- Merge medio
- 4 d 11 h
- PR fusionados (30 d)
- 35
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DouglasNeuroInformatics/OpenDataCapture
-
Area: Infrastructure Chore Difficulty: Low Priority: Medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
DouglasNeuroInformatics/OpenDataCapture#1835 ·
Los mantenedores suelen responder en 1 día
-
Interactive With JSPsych example submits a DataCollection its own schema rejectsPosiblemente ocupada @Sanilas-ai la tomó hace 2 días. AbiertoArea: Playground Bug Difficulty: Low Good First Issue Priority: Medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
DouglasNeuroInformatics/OpenDataCapture#1833 ·
Los mantenedores suelen responder en 1 día
-
Area: Instruments Bug Difficulty: Low Priority: Low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DouglasNeuroInformatics/OpenDataCapture#1824 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Area: Shared Bug Difficulty: Low Priority: Low
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
DouglasNeuroInformatics/OpenDataCapture#1813 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Multiple instructions show as one comma-joined paragraph ("questions., Conditional")Posiblemente ocupada @Sanilas-ai la tomó hace 2 días. AbiertoArea: Shared Bug Difficulty: Low Good First Issue Priority: Low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DouglasNeuroInformatics/OpenDataCapture#1812 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de DouglasNeuroInformatics/OpenDataCapture
Issues similares
-
Add API: BlockVectra Data APIAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
remotion-dev/remotion#12905 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
supermomonga/paseo-plugin-zcode-provider#83 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
oxidecomputer/skepsis#102 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
voidzero-dev/void#677 ·
Los mantenedores suelen responder en 1 día