Uploaded image for project: 'Shiro'
  1. Shiro
  2. SHIRO-392

Shiro Extension for JAX-RS

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.4.0-RC2
    • None
    • None

    Description

      We've added an extension to Shiro which enables Shiro annotations in the JAX-RS implementation Sun Jersey.
      You can do the following with it:

      @Path("/changelog")
      @RequiresPermissions("repository:read")
      public class ChangelogResourceImpl {

      @POST
      @Consumes(MediaType.APPLICATION_JSON)
      @Path("/addObject")
      @Override
      @RequiresPermissions("repository:write")
      public Response addObject(ObjectJson objectJson)

      { someService.addObject(object); return Response.ok().build(); }

      }

      If the user is not authenticated Http Status Code 401 is returned. If the user has insufficient privileges Status Code 403 is returned.

      Right now we've only added support for the annoation @RequiresPermissions. The other Shiro annoations could easily be added in the same fashion. Yet currently that's the only one we need.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              remast Jan Stamer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: