java - @RolesAllowed annotation works well with dropwizard resource but not with field level entity filtering -
in project, have need filter out fields based on roles. unfortunately not working me.
application.java
environment.jersey().getresourceconfig() .packages("com.test") .register(securityentityfilteringfeature.class).register(rolesalloweddynamicfeature.class) .register(jacksonfeature.class); entity needs filtered
@rolesallowed("edit") public list<participant> getparticipants() { return participants; } resource
@api("test api") @path("/api/v1/test") @produces(mediatype.application_json) @slf4j @rolesallowed("participate") public class testresource { @get @path("/{id}") @apioperation(value = "retrieve id", response = testresponse.class) @unitofwork public response getbyid(@pathparam("id") string testtid) { return testservice.findbyid(testid)); } } my logged in user having 2 permissions (edit, participate) , works @ resource level. not working @ entity field level. @ field level logged in role not considered , filtering participant field.
Comments
Post a Comment