blob: bcfab3916e86414a6517deae9109a7431724e488 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_65) on Fri Mar 04 17:58:55 EST 2016 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
AuthorizationInfo (Apache Shiro 1.2.4 API)
</TITLE>
<META NAME="date" CONTENT="2016-03-04">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="AuthorizationInfo (Apache Shiro 1.2.4 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/AuthorizationInfo.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/shiro/authz/Authorizer.html" title="interface in org.apache.shiro.authz"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/shiro/authz/AuthorizationInfo.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="AuthorizationInfo.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.shiro.authz</FONT>
<BR>
Interface AuthorizationInfo</H2>
<DL>
<DT><B>All Superinterfaces:</B> <DD><A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A></DD>
</DL>
<DL>
<DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../../org/apache/shiro/authc/Account.html" title="interface in org.apache.shiro.authc">Account</A></DD>
</DL>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/apache/shiro/authc/SimpleAccount.html" title="class in org.apache.shiro.authc">SimpleAccount</A>, <A HREF="../../../../org/apache/shiro/authz/SimpleAuthorizationInfo.html" title="class in org.apache.shiro.authz">SimpleAuthorizationInfo</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <A HREF="../../../../src-html/org/apache/shiro/authz/AuthorizationInfo.html#line.58"><B>AuthorizationInfo</B></A><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A></DL>
</PRE>
<P>
<code>AuthorizationInfo</code> represents a single Subject's stored authorization data (roles, permissions, etc)
used during authorization (access control) checks only.
<p/>
Roles are represented as a <code>Collection</code> of Strings
(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util"><CODE>Collection</CODE></A><<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><CODE>String</CODE></A>>), typically each element being the Role name.
<p/>
<A HREF="../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz"><CODE>Permission</CODE></A>s are provided in two ways:
<ul>
<li>A <code>Collection</code> of Strings, where each String can usually be converted into <code>Permission</code>
objects by a <code>Realm</code>'s
<A HREF="../../../../org/apache/shiro/authz/permission/PermissionResolver.html" title="interface in org.apache.shiro.authz.permission"><CODE>PermissionResolver</CODE></A></li>
<li>A <code>Collection</code> of <A HREF="../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz"><CODE>Permission</CODE></A> objects</li>
</ul>
Both permission collections together represent the total aggregate collection of permissions. You may use one
or both depending on your preference and needs.
<p/>
Because the act of authorization (access control) is orthoganal to authentication (log-in), this interface is
intended to represent only the account data needed by Shiro during an access control check
(role, permission, etc). Shiro also has a parallel
<A HREF="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationInfo</CODE></A> interface for use during the authentication
process that represents identity data such as principals and credentials.
<p/>
Because many if not most <A HREF="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm"><CODE>Realm</CODE></A>s store both sets of data for a Subject, it might be
convenient for a <code>Realm</code> implementation to utilize an implementation of the
<A HREF="../../../../org/apache/shiro/authc/Account.html" title="interface in org.apache.shiro.authc"><CODE>Account</CODE></A> interface instead, which is a convenience interface that combines both
<code>AuthenticationInfo</code> and <code>AuthorizationInfo</code>. Whether you choose to implement these two
interfaces separately or implement the one <code>Account</code> interface for a given <code>Realm</code> is
entirely based on your application's needs or your preferences.
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>0.9</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc"><CODE>AuthenticationInfo</CODE></A>,
<A HREF="../../../../org/apache/shiro/authc/Account.html" title="interface in org.apache.shiro.authc"><CODE>Account</CODE></A></DL>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz">Permission</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/authz/AuthorizationInfo.html#getObjectPermissions()">getObjectPermissions</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns all type-safe <A HREF="../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz"><CODE>Permission</CODE></A>s assigned to the corresponding Subject.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/authz/AuthorizationInfo.html#getRoles()">getRoles</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the names of all roles assigned to a corresponding Subject.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/authz/AuthorizationInfo.html#getStringPermissions()">getStringPermissions</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns all string-based permissions assigned to the corresponding Subject.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="getRoles()"><!-- --></A><H3>
getRoles</H3>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&gt; <A HREF="../../../../src-html/org/apache/shiro/authz/AuthorizationInfo.html#line.65"><B>getRoles</B></A>()</PRE>
<DL>
<DD>Returns the names of all roles assigned to a corresponding Subject.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the names of all roles assigned to a corresponding Subject.</DL>
</DD>
</DL>
<HR>
<A NAME="getStringPermissions()"><!-- --></A><H3>
getStringPermissions</H3>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&gt; <A HREF="../../../../src-html/org/apache/shiro/authz/AuthorizationInfo.html#line.82"><B>getStringPermissions</B></A>()</PRE>
<DL>
<DD>Returns all string-based permissions assigned to the corresponding Subject. The permissions here plus those
returned from <A HREF="../../../../org/apache/shiro/authz/AuthorizationInfo.html#getObjectPermissions()"><CODE>getObjectPermissions()</CODE></A> represent the total set of permissions
assigned. The aggregate set is used to perform a permission authorization check.
<p/>
This method is a convenience mechanism that allows Realms to represent permissions as Strings if they choose.
When performing a security check, a <code>Realm</code> usually converts these strings to object
<A HREF="../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz"><CODE>Permission</CODE></A>s via an internal
<A HREF="../../../../org/apache/shiro/authz/permission/PermissionResolver.html" title="interface in org.apache.shiro.authz.permission"><CODE>PermissionResolver</CODE></A>
in order to perform the actual permission check. This is not a requirement of course, since <code>Realm</code>s
can perform security checks in whatever manner deemed necessary, but this explains the conversion mechanism that
most Shiro Realms execute for string-based permission checks.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>all string-based permissions assigned to the corresponding Subject.</DL>
</DD>
</DL>
<HR>
<A NAME="getObjectPermissions()"><!-- --></A><H3>
getObjectPermissions</H3>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz">Permission</A>&gt; <A HREF="../../../../src-html/org/apache/shiro/authz/AuthorizationInfo.html#line.91"><B>getObjectPermissions</B></A>()</PRE>
<DL>
<DD>Returns all type-safe <A HREF="../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz"><CODE>Permission</CODE></A>s assigned to the corresponding Subject. The permissions
returned from this method plus any returned from <A HREF="../../../../org/apache/shiro/authz/AuthorizationInfo.html#getStringPermissions()"><CODE>getStringPermissions()</CODE></A>
represent the total set of permissions. The aggregate set is used to perform a permission authorization check.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>all type-safe <A HREF="../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz"><CODE>Permission</CODE></A>s assigned to the corresponding Subject.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/AuthorizationInfo.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/shiro/authz/Authorizer.html" title="interface in org.apache.shiro.authz"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/shiro/authz/AuthorizationInfo.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="AuthorizationInfo.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 2004-2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>