[jboss-cvs] JBossAS SVN: r69466 - projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jan 29 15:46:25 EST 2008
Author: sguilhen at redhat.com
Date: 2008-01-29 15:46:25 -0500 (Tue, 29 Jan 2008)
New Revision: 69466
Modified:
projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACL.java
projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACLEntry.java
projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACLPermission.java
projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACLProvider.java
Log:
Added new methods to ACLProvider and ACL. Updated Javadocs.
Modified: projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACL.java
===================================================================
--- projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACL.java 2008-01-29 19:30:07 UTC (rev 69465)
+++ projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACL.java 2008-01-29 20:46:25 UTC (rev 69466)
@@ -29,13 +29,13 @@
/**
* <p>
* This interface represents an Access Control List (ACL), a data structure used to protect access
- * to resources. It is composed of entries, where each entry is represented by the <code>ALCEntry</code>
+ * to resources. It is composed of entries, where each entry is represented by the {@code ALCEntry}
* class and represents the permissions assigned to a given identity.
* </p>
* <p>
* When a client attempts to perform an operation on a resource, the ACL associated to the resource is used
* to verify if the client has enough permissions to perform that operation. In order to do that, the
- * <code>ACLEntry</code> corresponding to the client's identity is retrieved and then the permission set
+ * {@code ACLEntry} corresponding to the client's identity is retrieved and then the permission set
* contained in the entry is verified to decide if access should be granted or not.
* </p>
*
@@ -46,12 +46,12 @@
/**
* <p>
- * Adds an entry to this ACL. If the ACL already has an <code>ACLEntry</code> associated to the new
+ * Adds an entry to this ACL. If the ACL already has an {@code ACLEntry} associated to the new
* entry's identity, then the new entry will not be added.
* </p>
*
- * @param entry the <code>ACLEntry</code> to be added.
- * @return <code>true</code> if the entry was added; <code>false</code> otherwise.
+ * @param entry the {@code ACLEntry} to be added.
+ * @return {@code true} if the entry was added; {@code false} otherwise.
*/
public boolean addEntry(ACLEntry entry);
@@ -60,39 +60,39 @@
* Removes an entry from this ACL.
* </p>
*
- * @param entry the <code>ACLEntry</code> to be removed.
- * @return <code>true</code> if the entry is removed; <code>false</code> if the entry can't be found
+ * @param entry the {@code ACLEntry} to be removed.
+ * @return {@code true} if the entry is removed; {@code false} if the entry can't be found
* in the ACL.
*/
public boolean removeEntry(ACLEntry entry);
/**
* <p>
- * Obtains the collection of all <code>ACLEntries</code> in this ACL.
+ * Obtains the collection of all {@code ACLEntries} in this ACL.
* </p>
*
- * @return a <code>Collection</code> containing all entries in this ACL.
+ * @return a {@code Collection} containing all entries in this ACL.
*/
- public Collection<ACLEntry> getEntries();
+ public Collection<? extends ACLEntry> getEntries();
/**
* <p>
* Obtains a reference to the resource being protected by this ACL.
* </p>
*
- * @return a reference to the <code>Resource</code>.
+ * @return a reference to the {@code Resource}.
*/
public Resource getResource();
/**
* <p>
- * Verify if the given permission is assigned to the specified <code>Identity</code>.
+ * Verify if the given permission is assigned to the specified {@code Identity}.
* </p>
*
- * @param permission the <code>ACLPermission</code> to be checked for.
- * @param identity the <code>Identity</code> being verified.
- * @return <code>true</code> if the specified permission is assigned to the identity;
- * <code>false</code> otherwise.
+ * @param permission the {@code ACLPermission} to be checked for.
+ * @param identity the {@code Identity} being verified.
+ * @return {@code true} if the specified permission is assigned to the identity;
+ * {@code false} otherwise.
*/
public boolean isGranted(ACLPermission permission, Identity identity);
}
Modified: projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACLEntry.java
===================================================================
--- projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACLEntry.java 2008-01-29 19:30:07 UTC (rev 69465)
+++ projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACLEntry.java 2008-01-29 20:46:25 UTC (rev 69466)
@@ -35,20 +35,20 @@
/**
* <p>
- * Obtains the <code>Identity</code> for which a permission has been assigned in
+ * Obtains the {@code Identity} for which a permission has been assigned in
* this entry.
* </p>
*
- * @return a reference to the <code>Identity</code> contained in this entry.
+ * @return a reference to the {@code Identity} contained in this entry.
*/
public Identity getIdentity();
/**
* <p>
- * Obtains the <code>Permission</code> object held by this entry.
+ * Obtains the {@code Permission} object held by this entry.
* </p>
*
- * @return a reference to the <code>Permission</code> contained in this entry.
+ * @return a reference to the {@code Permission} contained in this entry.
*/
public ACLPermission getPermission();
@@ -57,9 +57,9 @@
* Checks if the specified permission is part of the this entry's permission.
* </p>
*
- * @param permission the <code>ACLPermission</code> to be checked for.
- * @return <code>true</code> if the permission is part of this entry's permission;
- * <code>false</code> otherwise.
+ * @param permission the {@code ACLPermission} to be checked for.
+ * @return {@code true} if the permission is part of this entry's permission;
+ * {@code false} otherwise.
*/
public boolean checkPermission(ACLPermission permission);
}
Modified: projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACLPermission.java
===================================================================
--- projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACLPermission.java 2008-01-29 19:30:07 UTC (rev 69465)
+++ projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACLPermission.java 2008-01-29 20:46:25 UTC (rev 69466)
@@ -23,8 +23,8 @@
/**
* <p>
- * A <code>Permission</code> represents privileges held by an <code>Identity</code>, and is used to
- * grant or deny access to a <code>Resource</code>.
+ * A {@code Permission} represents privileges held by an {@code Identity}, and is used to
+ * grant or deny access to a {@code Resource}.
* </p>
*
* @author <a href="mailto:sguilhen at redhat.com">Stefan Guilhen</a>
Modified: projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACLProvider.java
===================================================================
--- projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACLProvider.java 2008-01-29 19:30:07 UTC (rev 69465)
+++ projects/security/security-spi/trunk/acl/src/main/org/jboss/security/acl/ACLProvider.java 2008-01-29 20:46:25 UTC (rev 69466)
@@ -21,11 +21,13 @@
*/
package org.jboss.security.acl;
+import java.util.Collection;
+
import org.jboss.security.authorization.Resource;
/**
* <p>
- * An <code>ACLProvider</code> is responsible for the management of the ACLs associated to the
+ * An {@code ACLProvider} is responsible for the management of the ACLs associated to the
* resources being protected. Implementations of this interface will tipically interact with some
* sort of repository, where the ACLs are stored.
* </p>
@@ -37,52 +39,63 @@
/**
* <p>
- * Obtains a reference to the <code>ACL</code> associated to the given resource.
+ * Obtains a reference to the {@code ACL} associated to the given resource.
* </p>
*
- * @param resource the <code>Resource</code> for which the associated ACL is wanted.
- * @return a reference to the <code>ACL</code> associated with the resource, or null if no
+ * @param resource the {@code Resource} for which the associated ACL is wanted.
+ * @return a reference to the {@code ACL} associated with the resource, or null if no
* ACL could be found.
*/
- public ACL retrieveACL(Resource resource);
+ public ACL getACL(Resource resource);
/**
* <p>
- * Creates a new ACL and associates it to the given resource.
+ * Creates a new {@code ACL} and associates it to the given resource.
* </p>
*
- * @param resource the <code>Resource</code> for which an ACL is to be created.
- * @return a reference to the created <code>ACL</code>.
+ * @param resource the {@code Resource} for which an ACL is to be created.
+ * @return a reference to the created {@code ACL}.
*/
public ACL createACL(Resource resource);
/**
* <p>
- * Updates the given ACL. This usually means updating the repository where the ACLs are stored.
+ * Creates a new {@code ACL} with the specified entries and associates it to the given resource.
* </p>
*
- * @param acl the <code>ACL</code> that needs to be updated.
- * @return <code>true</code> if the ACL was updated; <code>false</code> otherwise.
+ * @param resource the {@code Resource} for which an ACL is to be created.
+ * @param entries a {@code Collection} containing the entries that must be added to the {@code ACL}.
+ * @return a reference to the created {@code ACL}.
*/
+ public ACL createACL(Resource resource, Collection<ACLEntry> entries);
+
+ /**
+ * <p>
+ * Updates the given {@code ACL}. This usually means updating the repository where the ACLs are stored.
+ * </p>
+ *
+ * @param acl the {@code ACL} that needs to be updated.
+ * @return {@code true} if the ACL was updated; {@code false} otherwise.
+ */
public boolean updateACL(ACL acl);
/**
* <p>
- * Removes the given ACL, breaking the existing association with the resource it relates to.
+ * Removes the given {@code ACL}, breaking the existing association with the resource it relates to.
* </p>
*
- * @param acl a reference to the <code>ACL</code> that is to be removed.
- * @return <code>true</code> if the ACL was removed; <code>false</code> otherwise.
+ * @param acl a reference to the {@code ACL} that is to be removed.
+ * @return {@code true} if the ACL was removed; {@code false} otherwise.
*/
public boolean removeACL(ACL acl);
/**
* <p>
- * Removes the ACL associated with the specified resource.
+ * Removes the {@code ACL} associated with the specified resource.
* </p>
*
- * @param resource the <code>Resource</code> whose associated ACL is to be removed.
- * @return <code>true</code> if the ACL was removed; <code>false</code> otherwise.
+ * @param resource the {@code Resource} whose associated ACL is to be removed.
+ * @return {@code true} if the ACL was removed; {@code false} otherwise.
*/
public boolean removeACL(Resource resource);
More information about the jboss-cvs-commits
mailing list