-
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.
![Screen Shot 2022-01-29 at 10 27 43 PM](https://user-images.githubusercontent.com/3886740/151689248-6dc4d9ea-15c8-4d7d-b3d0-1a2b1d7873bb.png)
![Screen Shot 2022-01-29 at 10 29 01 PM](https://user-images.githubusercontent.com/3886740/151689291-191e42ff-b555-4eb0-9b72-4967ef11353d.png)
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: