You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "Devendra Mani (JIRA)" <ji...@apache.org> on 2014/06/25 11:48:25 UTC

[jira] [Comment Edited] (SHIRO-450) Create a new tag on the shiro-web project

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

Devendra Mani edited comment on SHIRO-450 at 6/25/14 9:47 AM:
--------------------------------------------------------------

I think instead of using the shiro tld from this you can use your own tld by creating a custome tag lib

<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.0" xmlns="http://java.sun.com/xml/ns/j2ee" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd">
  <tlib-version>1.0</tlib-version>
    <short-name>ct</short-name>
    <uri>/WEB-INF/customTag</uri>
<tag>
<name>hasAnyPermission</name>
<tag-class>in.org.cris.oaew.rshl.shiro.HasAnyPermissionTag</tag-class>
<body-content>JSP</body-content>
<description>Displays body content only if the current Subject (user)
'has' (implies) the specified permission (i.e the user has the specified ability).
</description>
<attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>


Now you can use like <ct:hasAnyPermission name="printer:register,pc:register">


was (Author: devmgs):
I think instead of using the shiro tld from this you can use your own tld by creating a custome tag lib

<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.0" xmlns="http://java.sun.com/xml/ns/j2ee" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd">
  <tlib-version>1.0</tlib-version>
    <short-name>ct</short-name>
    <uri>/WEB-INF/customTag</uri>
<tag>
<name>hasAnyPermission</name>
<tag-class>in.org.cris.oaew.rshl.shiro.HasAnyPermissionTag</tag-class>
<body-content>JSP</body-content>
<description>Displays body content only if the current Subject (user)
'has' (implies) the specified permission (i.e the user has the specified ability).
</description>
<attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>

> Create a new tag <hasAnyPermission> on the shiro-web project
> ------------------------------------------------------------
>
>                 Key: SHIRO-450
>                 URL: https://issues.apache.org/jira/browse/SHIRO-450
>             Project: Shiro
>          Issue Type: Improvement
>          Components: Authorization (access control) , Web
>    Affects Versions: 1.2.1
>            Reporter: Harry Chan
>            Priority: Minor
>         Attachments: HasAnyPermissionTag.java, shiro.tld
>
>
> In the Shiro web page: http://shiro.apache.org/web.html#Web-JSP%2FGSPTagLibrary
> I found that there is a <hasAnyRole> tag but NO <hasAnyPermission> tag.
> I am wondering if there is a plan to implement the <hasAnyPermission> tag.



--
This message was sent by Atlassian JIRA
(v6.2#6252)