first implementation of JSF 2.2 shiro faces tag lib

This commit is contained in:
jomu
2016-07-08 11:16:18 +00:00
parent b411b6aff9
commit c2458139b3
18 changed files with 867 additions and 0 deletions

View File

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2016 Joern Muehlencord <joern at muehlencord.de>.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<facelet-taglib version="2.2"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facelettaglibrary_2_2.xsd">
<namespace>http://shiro.apache.org/tags</namespace>
<tags>
<tag>
<tag-name>authenticated</tag-name>
<handler-class>de.muehlencord.shirofaces.tags.AuthenticatedTag</handler-class>
<description>Displays body content only if the current user has successfully authenticated
_during their current session_. It is more restrictive than the 'user' tag.
It is logically opposite to the 'notAuthenticated' tag.
</description>
</tag>
<tag>
<tag-name>guest</tag-name>
<handler-class>de.muehlencord.shirofaces.tags.GuestTag</handler-class>
<description>Displays body content only if the current Subject IS NOT known to the system, either
because they have not logged in or they have no corresponding 'RememberMe' identity. It is logically
opposite to the 'user' tag.
</description>
</tag>
<tag>
<tag-name>hasAnyPermission</tag-name>
<handler-class>de.muehlencord.shirofaces.tags.HasAnyPermissionTag</handler-class>
<description>Displays body content only if the current user has one of the specified permissions from a comma-separated list of permissions.</description>
<attribute>
<description>comma-separated list of permissions to check for</description>
<name>name</name>
<required>true</required>
</attribute>
</tag>
<tag>
<tag-name>hasAnyRoles</tag-name>
<handler-class>de.muehlencord.shirofaces.tags.HasAnyRolesTag</handler-class>
<description>Displays body content only if the current user has one of the specified roles from a comma-separated list of role names.</description>
<attribute>
<description>comma-separated list of roles to check for</description>
<name>name</name>
<required>true</required>
</attribute>
</tag>
<tag>
<tag-name>hasPermission</tag-name>
<handler-class>de.muehlencord.shirofaces.tags.HasPermissionTag</handler-class>
<description>Displays body content only if the current user the given permission.</description>
<attribute>
<description>the permission to check for</description>
<name>name</name>
<required>true</required>
</attribute>
</tag>
<tag>
<tag-name>hasRole</tag-name>
<handler-class>de.muehlencord.shirofaces.tags.HasRoleTag</handler-class>
<description>Displays body content only if the current user has the given role.</description>
<attribute>
<description>the role to check for</description>
<name>name</name>
<required>true</required>
</attribute>
</tag>
<tag>
<tag-name>lacksPermission</tag-name>
<handler-class>de.muehlencord.shirofaces.tags.LacksPermissionTag</handler-class>
<description>Displays body content only if the current user has NOT the given permission.</description>
<attribute>
<description>the permission to check for</description>
<name>name</name>
<required>true</required>
</attribute>
</tag>
<tag>
<tag-name>lacksRole</tag-name>
<handler-class>de.muehlencord.shirofaces.tags.LacksRoleTag</handler-class>
<description>Displays body content only if the current user has NOT the given role.</description>
<attribute>
<description>the role to check for</description>
<name>name</name>
<required>true</required>
</attribute>
</tag>
<tag>
<tag-name>hasRole</tag-name>
<handler-class>de.muehlencord.shirofaces.tags.HasRoleTag</handler-class>
<attribute>
<description>the name of the role to check for</description>
<name>name</name>
<required>true</required>
</attribute>
</tag>
<tag>
<tag-name>notAuthenticated</tag-name>
<handler-class>de.muehlencord.shirofaces.tags.NotAuthenticatedTag</handler-class>
<description>Displays body content only if the current user has NOT succesfully authenticated
_during their current session_. It is logically opposite to the 'authenticated' tag.
</description>
</tag>
<tag>
<tag-name>user</tag-name>
<handler-class>de.muehlencord.shirofaces.tags.UserTag</handler-class>
<description>Displays body content only if the current Subject has a known identity, either
from a previous login or from 'RememberMe' services. Note that this is semantically different
from the 'authenticated' tag, which is more restrictive. It is logically
opposite to the 'guest' tag.
</description>
</tag>
</tags>
</facelet-taglib>