Issue Details (XML | Word | Printable)

Key: JERSEY-2013
Type: Task Task
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Michal Gajdos
Reporter: Michal Gajdos
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
jersey

Entity Data Filtering

Created: 07/Aug/13 04:55 PM   Updated: 11/Sep/13 02:40 PM   Resolved: 11/Sep/13 02:40 PM
Component/s: media
Affects Version/s: 2.1
Fix Version/s: 2.3

Time Tracking:
Original Estimate: 2 days
Original Estimate - 2 days
Remaining Estimate: 0 minutes
Remaining Estimate - 0 minutes
Time Spent: 3 days, 18 hours
Time Spent - 3 days, 18 hours

Tags:
Participants: Michal Gajdos


 Description  « Hide

Take advantage of @XmlNamedObjectGraph to support (un)marshalling subgraphs of JAXB entities for different security roles. (see [1])

For example:

@Path("projects")
@RolesAllowed({"manager", "developer", "client"})
public class ProjectsResource {

    @GET
    @Path("{id}")
    public Project getProject(@PathParam("id") final String id) {
        ...
    }
}
@XmlRootElement
public class Project {

    private Long id;
   
    private String description;

    @RolesAllowed({"manager", "developer"})
    private List<Task> tasks;

    @RolesAllowed({"manager", "client"})
    private List<Reports> reports;

    @RolesAllowed("manager")
    private List<User> developers;

    @XmlTransient
    // or @DenyAll
    private Date created;

    ...
}

Marshall, for:

  • client - id, description, reports
  • developer - id, description, tasks
  • manager - id, description, tasks, reports, developers

[1] http://blog.bdoughan.com/2013/03/moxys-object-graphs-inputoutput-partial.html



There are no comments yet on this issue.