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

Allow annotations to be parameterized based on method arguments

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      This would allow annotations to include dynamic values based on the String values of method arguments.

      For example:

      @RequiresPermissions( "editUser:${userId}" )
      public void editUser( String userId ) {
      ...
      }

      If the method was called as editUser( 3 ), JSecurity would then check the permission "editUser:3" and if the current subject doesn't have the permission, an AuthorizationException would be thrown.

      This should also work for the @RequiresRoles permission. An exception should also be thrown if the parameter specified cannot be found as a method argument.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jhaile Jeremy Haile
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: