question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request for Prisma support

See original GitHub issue

Requirements

Progress

  • ~interpreter for model properties~
  • custom js interpreter for PrismaQuery
  • get Prisma’s WhereInput type in generic way
  • casl rules transformer
  • PrimaAbility & types for custom Ability conditions matcher
  • testing
  • Docs
  • add to prisma e2e tests https://github.com/prisma/e2e-tests/
  • prisma example

Usage

import { AbilityBuilder } from "@casl/ability";
import { PrismaAbility, toPrismaQuery } from "@casl/prisma";

const { can, build } = new AbilityBuilder(PrismaAbility);

can("read", "User", { firstName: { startsWith: "John" } });

const ability = build();

await prisma.user.findMany({
  include: abilitiesQuery.include,
  where: {
    AND: [
       acessibleBy(ability).User, // permissions conditions
       { // business logic related conditions
         deleted: false
       }
    ]
  ]
});

Questions:

  1. Do I need to add definePrismaAbility() similar to defineAbility which creates Ability instance that supports MongoQuery?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:14
  • Comments:50 (25 by maintainers)

github_iconTop GitHub Comments

11reactions
lloydclossoncommented, Apr 13, 2021

@stalniy This is great. I paid the $600. Really looking forward to having this support in CASL. If the timeline on the start / end dates change please let me know.

7reactions
stalniycommented, May 8, 2021

The major work is done! Tomorrow, I plan to add tests and if all good, I will release the 1st alpha either tomorrow or on Mon

Read more comments on GitHub >

github_iconTop Results From Across the Web

Contact Support - Prisma
Contact Support for any issues or questions you want to submit as you use the Prisma Data Platform. Steps. Go to the Prisma...
Read more >
Request Support - Prisma Cloud - Palo Alto Networks
For contacting support, for information on support programs, to manage your account, or to open a support case, go to the Prisma Cloud...
Read more >
prisma - npm
If you have a security issue to report, please contact us at security@prisma.io. Support. Ask a question about Prisma. You can ask questions...
Read more >
Prisma Cloud External Integrations API (Latest)
Returns a list of the supported integration types. Note: This request does not support Prisma Cloud integrations with the following: Okta; Qualys; Tenable....
Read more >
Prisma | NestJS - A progressive Node.js framework
Prisma currently supports PostgreSQL, MySQL, SQL Server, SQLite, ... You are going to build a sample NestJS application with a REST API that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found