Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improved AbilityTuple #616

Merged
merged 3 commits into from
Jun 14, 2022

Conversation

scriptcoded
Copy link
Contributor

#615 forces the user to define their AppAbility like PrismaAbility<[string, 'all' | Subjects<{ ... }>]>. This fix makes sure the user does not have to provide the 'all' union and can define it like PrismaAbility<[string, Subjects<{ ... }>]>.

adds ExtendedAbilityTuple that adds 'all' to the subject of AbilityTuple
without requiring the user to manually add the type
@codecov-commenter
Copy link

codecov-commenter commented Apr 30, 2022

Codecov Report

Merging #616 (06ee9ee) into master (9f91ac4) will decrease coverage by 0.21%.
The diff coverage is 91.89%.

@@            Coverage Diff             @@
##           master     #616      +/-   ##
==========================================
- Coverage   93.95%   93.74%   -0.22%     
==========================================
  Files          32       32              
  Lines         711      719       +8     
  Branches      167      175       +8     
==========================================
+ Hits          668      674       +6     
- Misses         12       13       +1     
- Partials       31       32       +1     
Impacted Files Coverage Δ
packages/casl-prisma/src/PrismaAbility.ts 100.00% <ø> (ø)
...ckages/casl-prisma/src/prisma/PrismaQueryParser.ts 93.84% <75.00%> (-1.07%) ⬇️
packages/casl-mongoose/src/accessible_records.ts 80.00% <88.88%> (-5.19%) ⬇️
packages/casl-ability/src/utils.ts 95.23% <91.30%> (-0.82%) ⬇️
packages/casl-ability/src/RuleIndex.ts 94.87% <95.23%> (+0.42%) ⬆️
packages/casl-ability/src/structures/LinkedItem.ts 100.00% <100.00%> (ø)
packages/casl-angular/src/AbilityModule.ts 100.00% <100.00%> (ø)
packages/casl-angular/src/pipes.ts 100.00% <100.00%> (+4.16%) ⬆️
packages/casl-mongoose/src/accessible_fields.ts 95.23% <100.00%> (ø)
packages/casl-mongoose/src/mongo.ts 100.00% <100.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed9e684...06ee9ee. Read the comment docs.

@stalniy
Copy link
Owner

stalniy commented May 12, 2022

all may not be part of requirements. That’s why it’s optional. That’s why it was not a part of Subjects

@stalniy stalniy merged commit 270446f into stalniy:master Jun 14, 2022
@scriptcoded scriptcoded deleted the prisma-better-all-type branch July 22, 2022 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants