directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cp...@apache.org
Subject [11/43] directory-fortress-core git commit: added documentation
Date Thu, 06 Oct 2016 17:49:28 GMT
added documentation


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/ab95a17b
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/ab95a17b
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/ab95a17b

Branch: refs/heads/master
Commit: ab95a17b9e2a3493d0892a7dbcfabcd9a0e7bfbc
Parents: 6c68e41
Author: clp207 <clp207@psu.edu>
Authored: Fri Jan 29 14:14:11 2016 -0500
Committer: clp207 <clp207@psu.edu>
Committed: Wed Mar 30 15:44:22 2016 -0400

----------------------------------------------------------------------
 .../directory/fortress/core/AdminMgr.java       | 95 ++++++++++++++++++--
 .../directory/fortress/core/ReviewMgr.java      | 29 +++++-
 .../directory/fortress/core/impl/UserDAO.java   | 14 ++-
 .../core/model/PermissionAttribute.java         |  2 +-
 4 files changed, 130 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ab95a17b/src/main/java/org/apache/directory/fortress/core/AdminMgr.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/AdminMgr.java b/src/main/java/org/apache/directory/fortress/core/AdminMgr.java
index 93b6e18..f46703a 100755
--- a/src/main/java/org/apache/directory/fortress/core/AdminMgr.java
+++ b/src/main/java/org/apache/directory/fortress/core/AdminMgr.java
@@ -450,11 +450,40 @@ public interface AdminMgr extends Manageable
     void assignUser( UserRole uRole )
         throws SecurityException;
 
-    //TODO: add documentation
+    /**
+     * This method adds a roleConstraint (ftRC) to the user ldap entry. (ftRC=ROLE_NAME$type$CONSTRAINT_TYPE$CONSTRAINT_PASETNAME$CONSTRAINT_VALUE)
+     * <h4>required parameters</h4>
+     * <ul>
+     *   <li>{@link UserRole#name} - contains the name for already existing Role to
be assigned</li>
+     *   <li>{@link UserRole#userId} - contains the userId for existing User</li>
+     *   <li>{@link RoleConstraint#type} - contains the type of role constraint (filter,
other)</li>
+     *   <li>{@link RoleConstraint#value} - contains the value of the role constraint
which is currently not validated in any way</li>
+     *   <li>{@link RoleConstraint#paSetName} - contains the userId for existing User,
contains the name of the permission attribute set this constraint is applicable for</li>
+     * </ul>
+     * 
+     * @param uRole must contain {@link UserRole#userId} and {@link UserRole#name}
+     * @param roleConstraint must contain {@link RoleConstraint#type} and {@link RoleConstraint#value}
and {@link RoleConstraint#paSetName}
+     * @return RoleConstraint that was added to user role assignment
+     * @throws SecurityException in the event of validation or system error.
+     */
     RoleConstraint addRoleConstraint( UserRole uRole, RoleConstraint roleConstraint )
     	throws SecurityException;
     
-    //TODO: remove documentation
+    /**
+     * Thie method removes a roleConstraint (ftRC) from the user ldap entry.
+     * <h4>required parameters</h4>
+     * <ul>
+     *   <li>{@link UserRole#name} - contains the name for already existing Role to
be assigned</li>
+     *   <li>{@link UserRole#userId} - contains the userId for existing User</li>
+     *   <li>{@link RoleConstraint#type} - contains the type of role constraint (filter,
other)</li>
+     *   <li>{@link RoleConstraint#value} - contains the value of the role constraint
which is currently not validated in any way</li>
+     *   <li>{@link RoleConstraint#paSetName} - contains the userId for existing User,
contains the name of the permission attribute set this constraint is applicable for</li>
+     * </ul>
+     * 
+     * @param uRole must contain {@link UserRole#userId} and {@link UserRole#name}
+     * @param roleConstraint must contain {@link RoleConstraint#type} and {@link RoleConstraint#value}
and {@link RoleConstraint#paSetName}   
+     * @throws SecurityException in the event of validation or system error.
+     */
     void removeRoleConstraint( UserRole uRole, RoleConstraint roleConstraint )
     	throws SecurityException;
     
@@ -521,19 +550,73 @@ public interface AdminMgr extends Manageable
         throws SecurityException;
 
     
-    //TODO: add documentation
+    /**
+     * This method will create a new permission attribute set object with resides under the

+     * {@code ou=Constraints,ou=RBAC,dc=yourHostName,dc=com} container in directory information
tree.
+     * The attribute set may contain 0 to many {@link org.apache.directory.fortress.core.model.PermissionAttribute}
+     * <h4>required parameters</h4>
+     * <ul>
+     *   <li>{@link PermissionAttributeSet#name} - contains the name of the permission
attribute set</li>
+     * </ul>
+     * 
+     * @param permAttributeSet must contain {@link PermissionAttributeSet#name}
+     * @return PermissionAttributeSet that was created
+     * @throws SecurityException - thrown in the event of perm attribute set data or system
error.
+     */
     PermissionAttributeSet addPermissionAttributeSet( PermissionAttributeSet permAttributeSet
)
     	throws SecurityException;
     
-    //TODO: add documentation
+    /**
+     * This method will delete a permission attribute set object.
+     * <h4>required parameters</h4>
+     * <ul>
+     *   <li>{@link PermissionAttributeSet#name} - contains the name of the permission
attribute set</li>
+     * </ul>
+     * 
+     * @param permAttributeSet must contain {@link PermissionAttributeSet#name}
+     * @throws SecurityException - thrown in the event of perm attribute set data or system
error.
+     */
     void deletePermissionAttributeSet( PermissionAttributeSet permAttributeSet )
         throws SecurityException;
     
-    //TODO: add documentation
+    /**
+     * This method adds a permission attribute (ftPA) to a permission attribute set.
+     * <h3></h3>
+     * <h4>required parameters</h4>
+     * <ul>
+     *   <li>{@link PermissionAttribute#attributeName} - contains the name of existing
object being targeted for the permission update</li>
+     *   <li>{@link PermissionAttribute#dataType} - contains the data type of the permission
attribute values (string,int,long,float)</li>   
+     *   <li>attributeSetName - contains the name of existing permission attribute
set being modified</li>
+     * </ul>  
+     * <h4>optional parameters</h4>
+     * <ul>
+     *   <li>{@link PermissionAttribute#required} - Flag to specify this attribute
is required, defaults to false.</li>
+     *   <li>{@link PermissionAttribute#operator} - Can specify an operator this attribute
must use.</li>
+     *   <li>{@link PermissionAttribute#validValues} - CSV of valid values. Currently
up to interpreting application to understand these.</li>
+     *   <li>{@link PermissionAttribute#defaultValue} - A default value for the attribute
value if none is specified.</li>
+     * </ul>
+     *   
+     * @param permAttribute must contain {@link PermissionAttribute#attributeName} and {@link
PermissionAttribute#dataType}
+     * @param attributeSetName The name of the permission attribute set this ftPA should
be added.
+     * @return PermissionAttribute entity created
+     * @throws SecurityException - thrown in the event of data or system error
+     */
     PermissionAttribute addPermissionAttributeToSet( PermissionAttribute permAttribute, String
attributeSetName )
     	throws SecurityException;
     
-    //TODO: add documentation
+    /**
+     * This method removed a permission attribute (ftPA) from an existing permission attribute
set.
+     * <h3></h3>
+     * <h4>required parameters</h4>
+     * <ul>
+     *   <li>{@link PermissionAttribute#attributeName} - contains the name of existing
object being targeted for the permission update</li>
+     *   <li>attributeSetName - contains the name of existing permission attribute
set being modified</li>
+     * </ul>     
+	 *
+     * @param permAttribute must contain {@link PermissionAttribute#attributeName}
+     * @param attributeSetName The name of the permission attribute set this ftPA should
be removed from
+     * @throws SecurityException - thrown in the event of data or system error
+     */
     void removePermissionAttributeFromSet( PermissionAttribute permAttribute, String attributeSetName
)
     	throws SecurityException;    
     

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ab95a17b/src/main/java/org/apache/directory/fortress/core/ReviewMgr.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ReviewMgr.java b/src/main/java/org/apache/directory/fortress/core/ReviewMgr.java
index 2f8dffe..5271b99 100755
--- a/src/main/java/org/apache/directory/fortress/core/ReviewMgr.java
+++ b/src/main/java/org/apache/directory/fortress/core/ReviewMgr.java
@@ -110,7 +110,18 @@ public interface ReviewMgr extends Manageable
     PermObj readPermObj( PermObj permObj )
         throws SecurityException;
 
-    //TODO: add documentation
+    /**
+     * Method read permission attribute set in directory
+     * <h3></h3>
+     * <h4>required parameters</h4>
+     * <ul>
+     *   <li>{@link PermissionAttributeSet#name} - contains the name of existing object
being targeted</li>
+     * </ul>
+     * 
+     * @param permAttributeSet  entity contains the {@link PermissionAttributeSet#name} of
target record.
+     * @return PermissionAttributeSet loaded with perm attribute set data.
+     * @throws SecurityException is thrown if object not found or system error.
+     */
     PermissionAttributeSet readPermAttributeSet( PermissionAttributeSet permAttributeSet
)
             throws SecurityException;
         
@@ -444,7 +455,21 @@ public interface ReviewMgr extends Manageable
     List<Permission> rolePermissions( Role role, boolean noInheritance )
         throws SecurityException;
 
-    //TODO: add documentation
+    /**
+     * This function returns all the permission attribute set (which contain 0 to many permission
attributes)
+     * for a given role. The function is valid if and only if the role is a member of the
ROLES data
+     * set.
+     *      * <h3></h3>
+     * <h4>required parameters</h4>
+     * <ul>
+     *   <li>{@link Role#name} - contains the name to use for the Role targeted for
search.</li>
+     * </ul>
+     * 
+     * @param role contains role name, {@link Role#name} of Role entity Permission is granted
to.
+     * @param noInheritance if true will NOT include inherited roles in the search.
+     * @return List of type PermissionAttributeSet that contains all Permission Attribute
valid for the role.
+     * @throws SecurityException In the event system error occurs.
+     */
     List<PermissionAttributeSet> rolePermissionAttributeSets( Role role, boolean noInhertiance
)
     	throws SecurityException;
     

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ab95a17b/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
index f2edc47..b1a0c9e 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/UserDAO.java
@@ -1824,6 +1824,12 @@ final class UserDAO extends ApacheDsDataProvider
         return userDn;
     }
 
+    /**
+     * @param uRole
+     * @param roleConstraint
+     * @throws UpdateException
+     * @throws FinderException
+     */
     void assign( UserRole uRole, RoleConstraint roleConstraint ) throws UpdateException,
FinderException
     {
     	LdapConnection ld = null;
@@ -1854,6 +1860,12 @@ final class UserDAO extends ApacheDsDataProvider
         }
     }
     
+    /**
+     * @param uRole
+     * @param roleConstraint
+     * @throws UpdateException
+     * @throws FinderException
+     */
     void deassign( UserRole uRole, RoleConstraint roleConstraint ) throws UpdateException,
FinderException
     {
     	LdapConnection ld = null;
@@ -1863,7 +1875,7 @@ final class UserDAO extends ApacheDsDataProvider
         try
         {
             List<Modification> mods = new ArrayList<Modification>();
-            szRoleConstraint = roleConstraint.gerRawData(uRole);
+            szRoleConstraint = roleConstraint.getRawData(uRole);
 
             mods.add( new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, GlobalIds.USER_ROLE_DATA,
             		szRoleConstraint ) );

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/ab95a17b/src/main/java/org/apache/directory/fortress/core/model/PermissionAttribute.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/model/PermissionAttribute.java
b/src/main/java/org/apache/directory/fortress/core/model/PermissionAttribute.java
index 453a784..eba8522 100644
--- a/src/main/java/org/apache/directory/fortress/core/model/PermissionAttribute.java
+++ b/src/main/java/org/apache/directory/fortress/core/model/PermissionAttribute.java
@@ -38,7 +38,7 @@ public class PermissionAttribute extends FortEntity implements Serializable
{
     private static final String DEFAULT_VALUE_PARAM_NAME = "defaultValue";
     
     private String attributeName;
-    private Boolean required;
+    private Boolean required = false;
     private ComparisonOperator operator;
     //TODO: make this an enum?
     private String dataType;


Mime
View raw message