<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Interface java.security.acl.Acl
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.security.acl.html">This Package</a>  <a href="Package-java.security.acl.html">Previous</a>  <a href="java.security.acl.AclEntry.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Interface java.security.acl.Acl
</h1>
<dl>
  <dt> public interface <b>Acl</b>
  <dt> extends <a href="java.security.acl.Owner.html#_top_">Owner</a>
</dl>
Interface representing an Access Control List (ACL).  An Access
 Control List is a data structure used to guard access to
 resources.<p>
 An ACL can be thought of as a data structure with multiple ACL
 entries.  Each ACL entry, of interface type AclEntry, contains a
 set of permissions associated with a particular principal. (A
 principal represents an entity such as an individual user or a
 group). Additionally, each ACL entry is specified as being either
 positive or negative. If positive, the permissions are to be
 granted to the associated principal. If negative, the permissions
 are to be denied.<p>
 The ACL Entries in each ACL observe the following rules:<p>
 <ul> <li>Each principal can have at most one positive ACL entry and
 one negative entry; that is, multiple positive or negative ACL
 entries are not allowed for any principal.  Each entry specifies
 the set of permissions that are to be granted (if positive) or
 denied (if negative). <p>
 <li>If there is no entry for a particular principal, then the
 principal is considered to have a null (empty) permission set.<p>
 <li>If there is a positive entry that grants a principal a
 particular permission, and a negative entry that denies the
 principal the same permission, the result is as though the
 permission was never granted or denied. <p>
 <li>Individual permissions always override permissions of the
 group(s) to which the individual belongs. That is, individual
 negative permissions (specific denial of permissions) override the
 groups' positive permissions. And individual positive permissions
 override the groups' negative permissions.<p>
 </ul>
 The <code> java.security.acl </code> package provides the
 interfaces to the ACL and related data structures (ACL entries,
 groups, permissions, etc.), and the <code> sun.security.acl </code>
 classes provide a default implementation of the interfaces. For
 example, <code> java.security.acl.Acl </code> provides the
 interface to an ACL and the <code> sun.security.acl.AclImpl </code>
 class provides the default implementation of the interface.<p>
 The <code> java.security.acl.Acl </code> interface extends the
 <code> java.security.acl.Owner </code> interface. The Owner
 interface is used to maintain a list of owners for each ACL.  Only
 owners are allowed to modify an ACL. For example, only an owner can
 call the ACL's <code>addEntry</code> method to add a new ACL entry
 to the ACL.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.security.acl.AclEntry.html#_top_">AclEntry</a>, <a href="java.security.acl.Owner.html#_top_">Owner</a>, <a href="#getPermissions">getPermissions</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addEntry(java.security.Principal, java.security.acl.AclEntry)"><b>addEntry</b></a>(Principal, AclEntry)
  <dd>  Adds an ACL entry to this ACL.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#checkPermission(java.security.Principal, java.security.acl.Permission)"><b>checkPermission</b></a>(Principal, Permission)
  <dd>  Checks whether or not the specified principal has the specified
 permission.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#entries()"><b>entries</b></a>()
  <dd>  Returns an enumeration of the entries in this ACL.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getName()"><b>getName</b></a>()
  <dd>  Returns the name of this ACL.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getPermissions(java.security.Principal)"><b>getPermissions</b></a>(Principal)
  <dd>  Returns an enumeration for the set of allowed permissions for the
 specified principal (representing an entity such as an individual or
 a group).
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#removeEntry(java.security.Principal, java.security.acl.AclEntry)"><b>removeEntry</b></a>(Principal, AclEntry)
  <dd>  Removes an ACL entry from this ACL.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setName(java.security.Principal, java.lang.String)"><b>setName</b></a>(Principal, String)
  <dd>  Sets the name of this ACL.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#toString()"><b>toString</b></a>()
  <dd>  Returns a string representation of the
 ACL contents.
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="setName(java.security.Principal, java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setName"><b>setName</b></a>
<pre>
 public abstract void setName(<a href="java.security.Principal.html#_top_">Principal</a> caller,
                              <a href="java.lang.String.html#_top_">String</a> name) throws <a href="java.security.acl.NotOwnerException.html#_top_">NotOwnerException</a>
</pre>
<dl>
  <dd> Sets the name of this ACL.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> caller - the principal invoking this method. It must be an
 owner of this ACL.
    <dd> name - the name to be given to this ACL.
    <dt> <b>Throws:</b> <a href="java.security.acl.NotOwnerException.html#_top_">NotOwnerException</a>
    <dd> if the caller principal
 is not an owner of this ACL.
  </dl></dd>
</dl>
<a name="getName()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getName"><b>getName</b></a>
<pre>
 public abstract <a href="java.lang.String.html#_top_">String</a> getName()
</pre>
<dl>
  <dd> Returns the name of this ACL.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the name of this ACL.
  </dl></dd>
</dl>
<a name="addEntry(java.security.Principal, java.security.acl.AclEntry)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addEntry"><b>addEntry</b></a>
<pre>
 public abstract boolean addEntry(<a href="java.security.Principal.html#_top_">Principal</a> caller,
                                  <a href="java.security.acl.AclEntry.html#_top_">AclEntry</a> entry) throws <a href="java.security.acl.NotOwnerException.html#_top_">NotOwnerException</a>
</pre>
<dl>
  <dd> Adds an ACL entry to this ACL. An entry associates a principal
 (e.g., an individual or a group) with a set of
 permissions. Each principal can have at most one positive ACL
 entry (specifying permissions to be granted to the principal)
 and one negative ACL entry (specifying permissions to be
 denied). If there is already an ACL entry of the same type
 (negative or positive) already in the ACL, false is returned.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> caller - the principal invoking this method. It must be an
 owner of this ACL.
    <dd> entry - the ACL entry to be added to this ACL.
    <dt> <b>Returns:</b>
    <dd> true on success, false if an entry of the same type
 (positive or negative) for the same principal is already
 present in this ACL.
    <dt> <b>Throws:</b> <a href="java.security.acl.NotOwnerException.html#_top_">NotOwnerException</a>
    <dd> if the caller principal
  is not an owner of this ACL.
  </dl></dd>
</dl>
<a name="removeEntry(java.security.Principal, java.security.acl.AclEntry)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="removeEntry"><b>removeEntry</b></a>
<pre>
 public abstract boolean removeEntry(<a href="java.security.Principal.html#_top_">Principal</a> caller,
                                     <a href="java.security.acl.AclEntry.html#_top_">AclEntry</a> entry) throws <a href="java.security.acl.NotOwnerException.html#_top_">NotOwnerException</a>
</pre>
<dl>
  <dd> Removes an ACL entry from this ACL.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> caller - the principal invoking this method. It must be an
 owner of this ACL.
    <dd> entry - the ACL entry to be removed from this ACL.
    <dt> <b>Returns:</b>
    <dd> true on success, false if the entry is not part of this ACL.
    <dt> <b>Throws:</b> <a href="java.security.acl.NotOwnerException.html#_top_">NotOwnerException</a>
    <dd> if the caller principal is not
 an owner of this Acl.
  </dl></dd>
</dl>
<a name="getPermissions(java.security.Principal)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getPermissions"><b>getPermissions</b></a>
<pre>
 public abstract <a href="java.util.Enumeration.html#_top_">Enumeration</a> getPermissions(<a href="java.security.Principal.html#_top_">Principal</a> user)
</pre>
<dl>
  <dd> Returns an enumeration for the set of allowed permissions for the
 specified principal (representing an entity such as an individual or
 a group). This set of allowed permissions is calculated as
 follows:<p>
 <ul>
 <li>If there is no entry in this Access Control List for the
 specified principal, an empty permission set is returned.<p>
 <li>Otherwise, the principal's group permission sets are determined.
 (A principal can belong to one or more groups, where a group is a
 group of principals, represented by the Group interface.)
 The group positive permission set is the union of all
 the positive permissions of each group that the principal belongs to.
 The group negative permission set is the union of all
 the negative permissions of each group that the principal belongs to.
 If there is a specific permission that occurs in both
 the positive permission set and the negative permission set,
 it is removed from both.<p>
 The individual positive and negative permission sets are also
 determined. The positive permission set contains the permissions
 specified in the positive ACL entry (if any) for the principal.
 Similarly, the negative permission set contains the permissions
 specified in the negative ACL entry (if any) for the principal.
 The individual positive (or negative) permission set is considered
 to be null if there is not a positive (negative) ACL entry for the
 principal in this ACL.<p>
 The set of permissions granted to the principal is then calculated
 using the simple rule that individual permissions always override
 the group permissions. That is, the principal's individual negative
 permission set (specific denial of permissions) overrides the group
 positive permission set, and the principal's individual positive
 permission set overrides the group negative permission set.
 </ul>
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> user - the principal whose permission set is to be returned.
    <dt> <b>Returns:</b>
    <dd> the permission set specifying the permissions the principal
 is allowed.
  </dl></dd>
</dl>
<a name="entries()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="entries"><b>entries</b></a>
<pre>
 public abstract <a href="java.util.Enumeration.html#_top_">Enumeration</a> entries()
</pre>
<dl>
  <dd> Returns an enumeration of the entries in this ACL. Each element in
 the enumeration is of type AclEntry.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> an enumeration of the entries in this ACL.
  </dl></dd>
</dl>
<a name="checkPermission(java.security.Principal, java.security.acl.Permission)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="checkPermission"><b>checkPermission</b></a>
<pre>
 public abstract boolean checkPermission(<a href="java.security.Principal.html#_top_">Principal</a> principal,
                                         <a href="java.security.acl.Permission.html#_top_">Permission</a> permission)
</pre>
<dl>
  <dd> Checks whether or not the specified principal has the specified
 permission. If it does, true is returned, otherwise false is returned.
 More specifically, this method checks whether the passed permission
 is a member of the allowed permission set of the specified principal.
 The allowed permission set is determined by the same algorithm as is
 used by the <code>getPermissions</code> method.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> principal - the principal, assumed to be a valid authenticated
 Principal.
    <dd> permission - the permission to be checked for.
    <dt> <b>Returns:</b>
    <dd> true if the principal has the specified permission, false
 otherwise.
    <dt> <b>See Also:</b>
    <dd> <a href="#getPermissions">getPermissions</a>
  </dl></dd>
</dl>
<a name="toString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="toString"><b>toString</b></a>
<pre>
 public abstract <a href="java.lang.String.html#_top_">String</a> toString()
</pre>
<dl>
  <dd> Returns a string representation of the
 ACL contents.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a string representation of the ACL contents.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#toString()">toString</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.security.acl.html">This Package</a>  <a href="Package-java.security.acl.html">Previous</a>  <a href="java.security.acl.AclEntry.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
