-
Notifications
You must be signed in to change notification settings - Fork 6
Receiving Error: Cannot find module './adapters/role-acl when attempting to add authorize to one of my models #241
Comments
It looks like you're trying to use I did used to support In particular, you should write an adapter that override these methods: https://github.com/JaneJeon/objection-authorize/blob/master/src/adapters/base.js#L97, and you can see an example of such implementation here: https://github.com/JaneJeon/objection-authorize/blob/master/src/adapters/casl.js. The "base" adapter already has all of the context necessary for the ACL library (in your case, |
Thank you, @JaneJeon . I wasn't trying to use role-acl but I will keep your feedback in mind from this point. Thank you also for getting back to me quick. |
Oh my god, I just realized what is going on now. You initialized the plugin WITHOUT specifying the library (in this case, it should be I'll fix this and release a new version ASAP |
Okay, I addressed it in https://github.com/JaneJeon/objection-authorize/releases/tag/v5.0.2. Try pulling the latest version :) |
Awesome, @JaneJeon ! Thank you for digging into it and finding the root cause of the issue there. |
I hope this message finds you well. In trying to implement "const authorize = require('objection-authorize')(acl, library[, opts])" from the Usage section of your repository, I am stalled due to a missing dependency in the objection-authorize directory. It looks like node is trying to find it and it appears to be missing.
I'm very much liking the project and hope this can be resolved. In my project, I added the file directly from the role-acl repository but only to see if the issue would be fixed in any way. Thank you for your time.
The text was updated successfully, but these errors were encountered: