Created
June 29, 2013 18:08
-
-
Save mjtoolbox/5892090 to your computer and use it in GitHub Desktop.
Shiro-Face Tag library and JSF page for usage. http://mjtoolbox.wordpress.com/2012/09/25/custom-tags-in-jsf-2-0-for-shiro-authorization/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="ISO-8859-1" ?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:f="http://java.sun.com/jsf/core" | |
xmlns:h="http://java.sun.com/jsf/html" | |
xmlns:ui="http://java.sun.com/jsf/facelets" | |
xmlns:shiro="http://xproject.flightCenter/tag"> | |
<h:head> | |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> | |
<link rel="stylesheet" type="text/css" href="../css/flight.css" | |
title="flight" media="screen,projection" /> | |
<title>Flight Center Home</title> | |
</h:head> | |
<h:body> | |
<f:view> | |
<div id="container"> | |
<ui:include src="top.xhtml" /> | |
<div id="content">Hello here is the content <shiro:principal/>. | |
<shiro:hasPermission name="navigation:viewUsers">Only Admin can see this line.</shiro:hasPermission> | |
<shiro:hasPermission name="navigation:viewCities">View Cities</shiro:hasPermission> | |
</div> | |
</div> | |
</f:view> | |
</h:body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd" | |
version="2.0"> | |
<namespace>http://xproject.flightCenter/tag</namespace> | |
<tag> | |
<tag-name>principal</tag-name> | |
<component> | |
<component-type>tag.PrincipalTag</component-type> | |
</component> | |
<attribute> | |
<description></description> | |
<name>type</name> | |
<required>false</required> | |
</attribute> | |
<attribute> | |
<description></description> | |
<name>property</name> | |
<required>false</required> | |
</attribute> | |
<attribute> | |
<description></description> | |
<name>defaultValue</name> | |
<required>false</required> | |
</attribute> | |
</tag> | |
<tag> | |
<tag-name>hasPermission</tag-name> | |
<handler-class>tag.HasPermissionTag</handler-class> | |
<attribute> | |
<description></description> | |
<name>name</name> | |
<required>true</required> | |
</attribute> | |
</tag> | |
<tag> | |
<tag-name>user</tag-name> | |
<handler-class>tag.UserTag</handler-class> | |
</tag> | |
</facelet-taglib> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment