shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Schayna (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SHIRO-484) Variables in annotations
Date Fri, 31 Jan 2014 09:44:08 GMT
Martin Schayna created SHIRO-484:
------------------------------------

             Summary: Variables in annotations
                 Key: SHIRO-484
                 URL: https://issues.apache.org/jira/browse/SHIRO-484
             Project: Shiro
          Issue Type: Improvement
          Components: Authorization (access control) 
    Affects Versions: 1.2.2
            Reporter: Martin Schayna
            Priority: Minor


I'm sure that I'm not the first who want it, but not found request about that. Are there any
plans for supporting variables in Shiro annotations? Instead of dynamic checking like that:

public Project getProject(String id) {
    SecurityUtils.getSubject().checkPermissions("project:" + id + ":read");
    ...
}

it would be nice to have:

@RequiresPermissions({"project:#id:read"})
public Project getProject(String id) {
    ...
}

variable reference could be in other syntax (${id}, $id, [id]...) or for better backward compatibility
variables should be marked by new annotation just like:

@RequiresPermissions({"project:#id:read"})
public Project getProject(@ShiroVariable("id") String id) {
    ...
}




--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message