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

(casl-mongoose) feat: Export AccessibleFieldDocumentMethods interface #733

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qqilihq
Copy link
Contributor

@qqilihq qqilihq commented Feb 12, 2023

It would be good to have the AccessibleFieldDocumentMethods interface exported. This makes it easier to further add further document methods:

import { accessibleFieldsPlugin, accessibleRecordsPlugin, AccessibleFieldDocumentMethods, AccessibleModel } from '@casl/mongoose';

interface IUserMethods extends AccessibleFieldDocumentMethods {
  validPassword(password: string): Promise<boolean>;
}

type UserModel = AccessibleModel<IUser, Record<string, never>, IUserMethods, IUserVirtuals>;
export type UserDocument = mongoose.HydratedDocument<IUser, IUserMethods, IUserVirtuals>;

@qqilihq qqilihq changed the title feat: Export AccessibleFieldDocumentMethods interface (casl-mongoose) feat: Export AccessibleFieldDocumentMethods interface Feb 12, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2023

Codecov Report

Merging #733 (cc88e28) into master (c795e8b) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #733   +/-   ##
=======================================
  Coverage   94.81%   94.81%           
=======================================
  Files          34       34           
  Lines         733      733           
  Branches      174      174           
=======================================
  Hits          695      695           
  Misses         18       18           
  Partials       20       20           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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

2 participants