Repository navigation
Cada función de cursos declara su nivel de acceso - #59
Open
Gaspilabastie wants to merge 9 commits into
Open
Gaspilabastie wants to merge 9 commits into
Gaspilabastie wants to merge 9 commits into
Conversation
publicQuery/publicMutation, memberQuery/memberMutation, courseQuery/courseMutation/courseAction and orgQuery/orgMutation run the access check before the handler. Course levels load the record from the arguments and check its opportunity's org and course through getOrgAccess and canAccessOpportunity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Qué pedía la tarea
Hacer que cada función del backend de ASTN declare su nivel de acceso. Hoy cada función de Convex tiene que acordarse de chequear el acceso por su cuenta, y los tests de permisos encontraron agujeros de funciones que se olvidaron. Este PR cubre las funciones de cursos.
Qué cambia
convex/lib/access.tstrae wrappers que corren el chequeo antes del handler:publicQuery/publicMutation: sin login (links de apply, poll y encuesta).memberQuery/memberMutation: alguien logueado actuando sobre lo suyo.courseQuery/courseMutation/courseActionconlevel: 'read' | 'edit' | 'admin': cargan el registro desde los argumentos (la oportunidad, o el poll, encuesta, postulación o borrador y su oportunidad) y chequean contra la org y el curso de esa oportunidad congetOrgAccess/canAccessOpportunity. Nunca con unorgIdouserIdque mande el que llama. El handler recibe lo cargado,userIdyaccess.orgQuery/orgMutation: lo que es de toda la org (canónicos, footer, conteos, la lista de oportunidades).orgOpportunities,opportunityApplications,availabilityPolls,feedbackSurveys,applicationInvitesyemails/{outbox,templateLibrary,outboxSend,adminBroadcastAction}. Las internas quedan como están.pnpm run lint:convexrechazaquery/mutation/actionsueltos en esos archivos (ACCESS_DECLARED_FILESeneslint.config.mjs, fácil de extender).CLAUDE.md(Conventions).Cómo declarar una función nueva
Comportamiento
No cambia quién puede llamar qué: la matriz de permisos y
scenarios.test.tspasan sin tocarlos. Diferencias menores: los errores de acceso ahora sonConvexErrorcon el mismo texto, y si alguien sin login pide algo que no existe ve "Not authenticated" en vez de "not found".Checks
pnpm run lint && pnpm run lint:convex(solo los 3 warnings que ya estaban)pnpm exec tsc -p convex/tsconfig.json --noEmitbun test src convex: 3331 pass, 0 failvp check --no-fmtnpx convex codegennecesita un deployment; agregué a mano la entrada delib/accessen_generated/api.d.ts, igual a la que genera codegen.vp buildno corre en esta Mac; lo corre CI.🤖 Generated with Claude Code