java - How to get resource object in RequestFilter in Jersey -
As it sounds, it is possible to get resource classes and methods with the help of Injection Resource Info, but Some methods need to be executed in the request filter class, so I need to get this object.
Or maybe the whole idea of getting the exact object in this case is wrong?
UPD: Here's a description of the basic problem:
For example, I have resources that are given to all users and by returning sub-resources for this particular user too Can:
@ path ("Users") Public Class User Resources {@GET List & lt; Users & gt; GetUsers () {...} @ path ("{id}") UserSubresource getById (PathParam ("id") string ID) {Return new users (getUserById (id)); }} Here is UserSubresource:
Public class UserSubresource {user user; @GET Public User getUser () {Return User}} ... is Public Boolean (Access) {user.isAccessibleByCurrentUser (); }} and I need to check the access rights for the getUser () method, I can not check permissions before searching for the actual user. I understand that I am checking this check Can be added to the getUser () method, but this situation is similar to some other institutions in my application, so I want a more general solution.
Comments
Post a Comment