JSecurity Plugin

Support WildcardPermission in the tag library

Details

  • Type: Sub-task Sub-task
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 0.4
  • Component/s: None
  • Labels:
    None
  • Environment:
    Grails-Jsecurity-0.4-SNAPSHOT
  • Patch Submitted:
    Yes

Description

Currently you cannot use the hasPermission tag like this:

<jsec:hasPermission permission="${'book:edit:'+book.id}">...</jsec:hasPermission>

You have to construct a WildcardPermission instance separately and pass that to the permission attribute of the tag.

JSecurity (0.9) has convenience methods on the Subject interface, that instead of taking a single Permission argument, they take a single String argument. JSecurity will delegate this call internally, but what's important: With the default setup a WildcardPermission will be created for you.
For details see: http://markmail.org/message/fip5gathvmk7po4l

The attached patch allows you to use the tag just like in the code snippet above by utilizing the single-String methods.

Activity

Hide
Peter Ledbrook added a comment -

Sorry for the delay. I was put off committing it by the idea of writing functional tests. The tests are now done though.

Show
Peter Ledbrook added a comment - Sorry for the delay. I was put off committing it by the idea of writing functional tests. The tests are now done though.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: