stack/docs/fern
CactusBlue 306f4e4c67
Permission Robustness (#591)
<!-- ELLIPSIS_HIDDEN -->


> [!IMPORTANT]
> Enhance permission management by adding unique constraints, handling
duplicate ID errors, and updating frontend and backend logic with
comprehensive tests.
> 
>   - **Database**:
> - Add unique constraint on `Permission` table for `[tenancyId,
queryableId]` in `migration.sql`.
>     - Update `schema.prisma` to reflect new unique constraints.
>   - **Backend**:
> - Update `crud.tsx` files to handle `PERMISSION_ID_ALREADY_EXISTS`
error using `isErrorForNonUniquePermission()`.
> - Add `isPrismaUniqueConstraintViolation()` in `prisma-client.tsx` to
identify unique constraint violations.
>     - Add `PermissionIdAlreadyExists` error in `known-errors.tsx`.
>   - **Frontend**:
> - Update `page-client.tsx` and `permission-table.tsx` to check for
duplicate permission IDs before creation.
>   - **Tests**:
> - Add tests in `project-permission-definitions.test.ts` and
`team-permission-definitions.test.ts` to verify duplicate ID handling.
> - Ensure permissions cannot be created with duplicate IDs across
project and team contexts.
> 
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=stack-auth%2Fstack-auth&utm_source=github&utm_medium=referral)<sup>
for b3ccd15bca. It will automatically
update as commits are pushed.</sup>


<!-- ELLIPSIS_HIDDEN -->

---------

Co-authored-by: Konsti Wohlwend <n2d4xc@gmail.com>
Co-authored-by: Zai Shi <zaishi00@outlook.com>
2025-04-02 01:12:13 +02:00
..
apis Webhooks (#157) 2024-08-01 02:44:35 +02:00
docs Permission Robustness (#591) 2025-04-02 01:12:13 +02:00
openapi Make @stackframe/docs private 2024-06-15 20:22:33 +02:00
custom-script.js Update SDK and component reference layout (#338) 2024-11-11 13:04:45 +01:00
docs-template.yml Add CLI authentication endpoints (#503) 2025-03-12 18:44:33 -07:00
docs.yml fixed links 2025-03-05 10:26:56 -08:00
fern.config.json Update Fern to 0.44.11 2024-11-12 15:40:04 +01:00
generators.yml Added fern docs (#76) 2024-06-15 14:04:00 +02:00
style.css fixed fern img style 2025-03-25 17:33:09 -07:00