adminjs icon indicating copy to clipboard operation
adminjs copied to clipboard

Add authentication information to resource function calls

Open efbenson opened this issue 3 years ago • 2 comments

Describe the problem feature solves We implemented our own resource to support our multitenant adminbro/adminjs instance, however without knowing what user (company) they are we do not know what collection to push/pull documents from. We have forked the entire project and can't keep up with new changes unfortunately.

Describe the solution you'd like When providing a custom resource also be passed the authentication information (request.auth) on any calls dealing with data pulling/updating/creating

Describe alternatives you've considered We have it working on a forked version of 3.3.1 and it works well, but its old.

Acceptance criteria Via a custom resource have the ability to see the user initiating the data requests/mutates

efbenson avatar Aug 29 '22 18:08 efbenson

By custom resource do you mean a custom adapter?

dziraf avatar Aug 29 '22 19:08 dziraf

@dziraf yes you are correct I was using the wrong terminology. We extend BaseResource https://docs.adminjs.co/BaseResource.html and make our own custom adapter. The BaseResource functions are the ones we would need the user auth added to so we can do the data filtering.

efbenson avatar Aug 30 '22 16:08 efbenson