[Feature Request] Custom Function Examples
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
- 52/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
- Área
- documentation
Línea de trabajo
The payload names the functions page at https://zenstack.dev/docs/reference/zmodel/function. Start by reading that page and nearby zmodel reference pages to see the existing example style. Add a short snippet that declares a custom function with parameters and a return type, plus how to call it inside an @allow policy rule. Done when the page includes both examples and the snippet matches the v3 syntax; preview the docs build to confirm it renders.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem? Please describe.
The v3 documentation mentions:
and you can also define your own functions in the schema.
However, there are no examples showing how to actually do this. It's currently hard to figure out the correct syntax for parameters, return types, and how to use them inside policies.
Describe the solution you'd like
It would be great to add a short code snippet to the functions page demonstrating:
- How to declare a custom function in the
.zmodelfile. - How to call it inside a policy rule (e.g.,
@allow).
Describe alternatives you've considered
Trying to guess the syntax via trial and error or searching for examples in the Discord community.
Additional context
https://zenstack.dev/docs/reference/zmodel/function
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.9k
- Forks
- 157
- Merge medio
- 2 d 46 min
- PR fusionados (30 d)
- 17
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 zenstackhq/zenstack
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
zenstackhq/zenstack#2873 ·
Los mantenedores suelen responder en 1 día
-
`@default` on a field of a `@map`-ed enum emits the enum name as the column defaultPosiblemente ocupada @jkugsiya la tomó hace 5 días. Abiertoruntime
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
zenstackhq/zenstack#2868 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
zenstackhq/zenstack#2694 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
zenstackhq/zenstack#2659 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
zenstackhq/zenstack#2542 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de zenstackhq/zenstack
Issues similares
-
Unsampled pageload span is profiled when profileLifecycle is 'trace' (browser UI profiling)Posiblemente ocupada @Jxxunnn la tomó hoy. AbiertoBrowser Waiting for: Product Owner
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
getsentry/sentry-javascript#25497 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
e2e-failure ready-to-code
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
redhat-developer/rhdh-plugin-export-overlays#4438 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
resource: destroying a resource calls AbortController.abort() without a reason, creating an AbortError with a stack trace each timePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoarea: core
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
angular/angular#71422 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug status: needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
facebook/docusaurus#12739 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
Dificultad 1/5 1-3 horas Aptitud para principiantes 68/100
vercel/ai#23537 · 1 comentario ·
Los mantenedores suelen responder en 1 día