[
https://issues.apache.org/jira/browse/SHIRO-657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16740582#comment-16740582
]
Brian Demers commented on SHIRO-657:
------------------------------------
[~linlinjava] If you are not using wildcards can you just use Resource bundle
when you generate your json file?
pseudo code:
{code}
ResourceBundle.getBundle("your-bundle-file").getString(requiresPermissions.getValue())
{code}
We would need to do something similar with `RequiresRoles` which in most cases
has the description defined someplace else (like a DB or an LDAP server)
I also have concerns when the same permission is used in multiple places,
possibly with a different description.
This also seems a bit tied to a web layer, which would mix concerns with
`RequiresPermissions`
I'm not trying to say this is a bad idea, just that I'm not sure it fits on
this annotation.
> Add desc to RequiresPermissions
> -------------------------------
>
> Key: SHIRO-657
> URL: https://issues.apache.org/jira/browse/SHIRO-657
> Project: Shiro
> Issue Type: Improvement
> Reporter: Junling Bu
> Priority: Minor
>
> This is a feature request.
> The use case is that I can parse RequiresPermissions to generate system
> permission list.
> However, I want to generate description text for each defined permission
> meanwhile.
> These texts will give better user experience rather than actual permissions.
> For example:
> {code:java}
> @RequiresPermissions(value="admin:list", desc="Admin List Permission")
> @GetMapping("/list")
> public Object list(){
> }
> {code}
> Afterwards, I can generate following json array and only show label property
> for users.
> {code:json}
> [
> {
> id: "admin:list",
> label: "Admin List Permission"
> }
> ...
> ]
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)