github zenstackhq/zenstack v2.3.0
ZenStack Release v2.3.0

latest releases: v2.8.1, v2.8.0, v2.7.5...
4 months ago

New Features

  • The new check() policy function that allows you to delegate a models' permission checking to its relations. #276

    model Todo {
        ...
        list List @relation(fields: [listId], references: [id])
    
        // if the parent list is readable, grant full access to this Todo entity
        @@allow('all', check(list, 'read'))
    }

    You can use this feature to remove duplicated policy rules and keep the schema DRY. See a full guide here.

  • Prisma 5.16.x is now supported. The new Prisma version introduced a typing breaking change. An adaptation is added in this version of ZenStack.

Documentation

Fixes and Improvements

  • Runtime error with disconnecting a self-relation #1530
  • Incorrect query result when using Prisma.DbNull to filter JSON fields #1533
  • Fixed the issue that using @length on a @password field checks the length of hash password rather than the original value #1502
  • Typing conflict with Prisma client extension (with polymorphism or auth() in @default() is used) #1493
  • IDE formatting issue when Unsupported type is used #1517
  • Runtime error when creating a polymorphic model that inherits from an abstract model #1560
  • Set timeout for checking newer versions when running CLI to avoid hangs under unstable network #1529
  • Typing issue in generated hooks for vue-query #1564
  • Excluded create and upsert for delegate models from generated hooks and trpc routers, as they cannot be directly created.
  • When generation @relation for delegate models, user-provided relation name should be used if it exists #1575 by @irvinzz
  • SWR is now added as a peer dependency of @zenstackhq/swr plugin.
  • The ZenStack monorepo has enabled corepack to enforce a consistent version of pnpm.

New Contributors

Thanks to @jasonmacdonald @benjamintd @irvinzz @mentorkadriu for contributing to this release! ❤️

Full Changelog: v2.2.4...v2.3.0

Don't miss a new zenstack release

NewReleases is sending notifications on new releases.