You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "Junling Bu (JIRA)" <ji...@apache.org> on 2019/01/06 16:14:00 UTC

[jira] [Commented] (SHIRO-657) Add desc to RequiresPermissions

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

Junling Bu commented on SHIRO-657:
----------------------------------

Currently I have to use another custom annotation in the place where RequiresPermissions is used. It can work for this use case. But I think it is not bad to add desc into RequiresPermissions 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)