[ 
https://issues.apache.org/jira/browse/SHIRO-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13581414#comment-13581414
 ] 

Juan Manuel CABRERA edited comment on SHIRO-417 at 2/19/13 4:32 PM:
--------------------------------------------------------------------

Would be a nice to have !
Something like this would be even better imho:
(sorry, I don't know how to format snippets correctly, {code} does not seem to 
work)

    public class MyBean {
        private String id;
        public String getId() { return id; }
    }

    public MyOtherClass {
        @RequiresPermissions("{name}:foo") 
        // 'arg' (or whatever fixed name) being the target of the 
@PermissionParam annotation
        public void retrieve(final @PermissionParam(value="name", 
expr="arg.id") MyBean obj) { 
            ... 
        }
    } 

                
      was (Author: juanma.cabrera):
    Would be a nice to have !
Something like this would be even better imho

{code} 
    public class MyBean {
        private String id;
        public String getId() { return id; }
    }

    @RequiresPermissions("{name}:foo") 
    // 'arg' (or whatever fixed name) being the target of the @PermissionParam 
annotation
    public void retrieve(final @PermissionParam(value="name", expr="arg.id") 
MyBean obj) { 
        ... 
    } 
{code}
                  
> allow basic templating in permission annotation matching parameters
> -------------------------------------------------------------------
>
>                 Key: SHIRO-417
>                 URL: https://issues.apache.org/jira/browse/SHIRO-417
>             Project: Shiro
>          Issue Type: New Feature
>            Reporter: Romain Manni-Bucau
>         Attachments: SHIRO-417.patch
>
>
> Here the idea:
> {code}
>    @RequiresPermissions("{name}:foo")
>     public void retrieve(final @PermissionParam("name") String name) {
>         ...
>     }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to