📄 turbinesecurity.html
字号:
<A NAME="accountExists(org.apache.turbine.om.security.User)"><!-- --></A><H3>accountExists</H3><PRE>public static boolean <B>accountExists</B>(<A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> user) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></PRE><DL><DD>Check whether a specified user's account exists. The login name is used for looking up the account.<DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - The user to be checked.<DT><B>Returns:</B><DD>true if the specified account exists<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there was an error accessing the data backend.</DL></DD></DL><HR><A NAME="accountExists(java.lang.String)"><!-- --></A><H3>accountExists</H3><PRE>public static boolean <B>accountExists</B>(java.lang.String username) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></PRE><DL><DD>Check whether a specified user's account exists. The login name is used for looking up the account.<DD><DL><DT><B>Parameters:</B><DD><CODE>usename</CODE> - The name of the user to be checked.<DT><B>Returns:</B><DD>true if the specified account exists<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there was an error accessing the data backend.</DL></DD></DL><HR><A NAME="getAuthenticatedUser(java.lang.String, java.lang.String)"><!-- --></A><H3>getAuthenticatedUser</H3><PRE>public static <A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> <B>getAuthenticatedUser</B>(java.lang.String username, java.lang.String password) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A>, <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A>, <A HREF="../../../../../org/apache/turbine/util/security/PasswordMismatchException.html">PasswordMismatchException</A></PRE><DL><DD>Authenticates an user, and constructs an User object to represent him/her.<DD><DL><DT><B>Parameters:</B><DD><CODE>username</CODE> - The user name.<DD><CODE>password</CODE> - The user password.<DT><B>Returns:</B><DD>An authenticated Turbine User.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there was an error accessing the data backend.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if user account is not present.<DD><CODE>PasswordMissmatchException</CODE> - if the supplied password was incorrect.</DL></DD></DL><HR><A NAME="getUser(java.lang.String)"><!-- --></A><H3>getUser</H3><PRE>public static <A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> <B>getUser</B>(java.lang.String username) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A>, <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></PRE><DL><DD>Constructs an User object to represent a registered user of the application.<DD><DL><DT><B>Parameters:</B><DD><CODE>username</CODE> - The user name.<DT><B>Returns:</B><DD>A Turbine User.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there was an error accessing the data backend.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if user account is not present.</DL></DD></DL><HR><A NAME="getUsers(org.apache.torque.util.Criteria)"><!-- --></A><H3>getUsers</H3><PRE>public static <A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A>[] <B>getUsers</B>(org.apache.torque.util.Criteria criteria) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></PRE><DL><DD>Retrieve a set of users that meet the specified criteria. As the keys for the criteria, you should use the constants that are defined in <A HREF="../../../../../org/apache/turbine/om/security/User.html"><CODE>User</CODE></A> interface, plus the names of the custom attributes you added to your user representation in the data storage. Use verbatim names of the attributes - without table name prefix in case of DB implementation.<DD><DL><DT><B>Parameters:</B><DD><CODE>criteria</CODE> - The criteria of selection.<DT><B>Returns:</B><DD>a List of users meeting the criteria.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there is a problem accessing the storage.</DL></DD></DL><HR><A NAME="getAnonymousUser()"><!-- --></A><H3>getAnonymousUser</H3><PRE>public static <A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> <B>getAnonymousUser</B>() throws <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></PRE><DL><DD>Constructs an User object to represent an anonymous user of the application.<DD><DL><DT><B>Returns:</B><DD>An anonymous Turbine User.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if the anonymous User object couldn't be constructed.</DL></DD></DL><HR><A NAME="saveUser(org.apache.turbine.om.security.User)"><!-- --></A><H3>saveUser</H3><PRE>public static void <B>saveUser</B>(<A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> user) throws <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A>, <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></PRE><DL><DD>Saves User's data in the permanent storage. The user account is required to exist in the storage.<DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if the user's account does not exist in the database.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there is a problem accessing the storage.</DL></DD></DL><HR><A NAME="changePassword(org.apache.turbine.om.security.User, java.lang.String, java.lang.String)"><!-- --></A><H3>changePassword</H3><PRE>public static void <B>changePassword</B>(<A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> user, java.lang.String oldPassword, java.lang.String newPassword) throws <A HREF="../../../../../org/apache/turbine/util/security/PasswordMismatchException.html">PasswordMismatchException</A>, <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A>, <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></PRE><DL><DD>Change the password for an User.<DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - an User to change password for.<DD><CODE>oldPassword</CODE> - the current password supplied by the user.<DD><CODE>newPassword</CODE> - the current password requested by the user.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/PasswordMismatchException.html">PasswordMismatchException</A></CODE> - if the supplied password was incorrect.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if the user's record does not exist in the database.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there is a problem accessing the storage.</DL></DD></DL><HR><A NAME="forcePassword(org.apache.turbine.om.security.User, java.lang.String)"><!-- --></A><H3>forcePassword</H3><PRE>public static void <B>forcePassword</B>(<A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> user, java.lang.String password) throws <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A>, <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></PRE><DL><DD>Forcibly sets new password for an User. This is supposed by the administrator to change the forgotten or compromised passwords. Certain implementatations of this feature would require administrative level access to the authenticating server / program.<DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - an User to change password for.<DD><CODE>password</CODE> - the new password.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if the user's record does not exist in the database.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there is a problem accessing the storage.</DL></DD></DL><HR><A NAME="getACL(org.apache.turbine.om.security.User)"><!-- --></A><H3>getACL</H3><PRE>public static <A HREF="../../../../../org/apache/turbine/util/security/AccessControlList.html">AccessControlList</A> <B>getACL</B>(<A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> user) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A>, <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></PRE><DL><DD>Constructs an AccessControlList for a specific user.<DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - the user for whom the AccessControlList are to be retrieved<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there was an error accessing the data backend.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if user account is not present.</DL></DD></DL><HR><A NAME="grant(org.apache.turbine.om.security.User, org.apache.turbine.om.security.Group, org.apache.turbine.om.security.Role)"><!-- --></A><H3>grant</H3><PRE>public static void <B>grant</B>(<A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> user, <A HREF="../../../../../org/apache/turbine/om/security/Group.html">Group</A> group, <A HREF="../../../../../org/apache/turbine/om/security/Role.html">Role</A> role) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A>, <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></PRE><DL><DD>Grant an User a Role in a Group.<DD><DL><DT><B>Parameters:</B><DD><CODE>User</CODE> - the user.<DD><CODE>Group</CODE> - the group.<DD><CODE>Role</CODE> - the role.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there was an error accessing the data backend.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if user account, group or role is not present.</DL></DD></DL><HR><A NAME="revoke(org.apache.turbine.om.security.User, org.apache.turbine.om.security.Group, org.apache.turbine.om.security.Role)"><!-- --></A><H3>revoke</H3><PRE>public static void <B>revoke</B>(<A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> user, <A HREF="../../../../../org/apache/turbine/om/security/Group.html">Group</A> group, <A HREF="../../../../../org/apache/turbine/om/security/Role.html">Role</A> role) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A>, <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></PRE><DL><DD>Revoke a Role in a Group from an User.<DD><DL><DT><B>Parameters:</B><DD><CODE>User</CODE> - the user.<DD><CODE>Group</CODE> - the group.<DD><CODE>Role</CODE> - the role.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there was an error accessing the data backend.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if user account, group or role is not present.</DL></DD></DL><HR><A NAME="revokeAll(org.apache.turbine.om.security.User)"><!-- --></A><H3>revokeAll</H3><PRE>public static void <B>revokeAll</B>(<A HREF="../../../../../org/apache/turbine/om/security/User.html">User</A> user) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A>, <A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></PRE><DL><DD>Revokes all roles from an User. This method is used when deleting an account.<DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - the User.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A></CODE> - if there was an error accessing the data backend.<DD><CODE><A HREF="../../../../../org/apache/turbine/util/security/UnknownEntityException.html">UnknownEntityException</A></CODE> - if the account is not present.</DL></DD></DL><HR><A NAME="grant(org.apache.turbine.om.security.Role, org.apache.turbine.om.security.Permission)"><!-- --></A><H3>grant</H3><PRE>public static void <B>grant</B>(<A HREF="../../../../../org/apache/turbine/om/security/Role.html">Role</A> role, <A HREF="../../../../../org/apache/turbine/om/security/Permission.html">Permission</A> permission) throws <A HREF="../../../../../org/apache/turbine/util/security/DataBackendException.html">DataBackendException</A>,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -