directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r586163 - in /directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin: Constants.java Profile.java Role.java User.java
Date Thu, 18 Oct 2007 22:42:32 GMT
Author: djencks
Date: Thu Oct 18 15:42:28 2007
New Revision: 586163

URL: http://svn.apache.org/viewvc?rev=586163&view=rev
Log:
remove admin profile object, make admin reles hierarchical and hook users up to roles

Removed:
    directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/Profile.java
Modified:
    directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/Constants.java
    directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/Role.java
    directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/User.java

Modified: directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/Constants.java
URL: http://svn.apache.org/viewvc/directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/Constants.java?rev=586163&r1=586162&r2=586163&view=diff
==============================================================================
--- directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/Constants.java
(original)
+++ directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/Constants.java
Thu Oct 18 15:42:28 2007
@@ -80,7 +80,10 @@
     String REF_ID = "ref";
     String GRANTS_ID = "grants";
     String DENIALS_ID = "denials";
+    String GRANTED_ROLES_ID = "grantedRoles";
+    String DENIED_ROLES_ID = "deniedRoles";
     String ROLES_ID = "roles";
+    String DEFAULT_ROLES_ID = "defaultRoles";
     String USER_ID = "user";
     String DOMAIN_COMPONENT_ID = "dc";
     String CREATE_TIMESTAMP_ID = "createTimestamp";

Modified: directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/Role.java
URL: http://svn.apache.org/viewvc/directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/Role.java?rev=586163&r1=586162&r2=586163&view=diff
==============================================================================
--- directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/Role.java
(original)
+++ directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/Role.java
Thu Oct 18 15:42:28 2007
@@ -45,6 +45,8 @@
     private static final int DESCRIPTION_INDEX = 1;
     private static final int GRANTS_INDEX = 2;
     private static final int DENIALS_INDEX = 3;
+    private static final int GRANTED_ROLES_INDEX = 4;
+    private static final int DENIED_ROLES_INDEX = 5;
 
     private final StateManager<Role> stateManager;
 
@@ -56,6 +58,8 @@
         stateManager.addField( new SingleValuedField<String>( Constants.DESCRIPTION_ID,
null ) );
         stateManager.addField( new ReferenceMapField<Permission>( Constants.GRANTS_ID,
stateManager ) );
         stateManager.addField( new ReferenceMapField<Permission>( Constants.DENIALS_ID,
stateManager ) );
+        stateManager.addField( new ReferenceMapField<Permission>( Constants.GRANTED_ROLES_ID,
stateManager ) );
+        stateManager.addField( new ReferenceMapField<Permission>( Constants.DENIED_ROLES_ID,
stateManager ) );
 
         stateManager.setState( State.EMPTY );
     }
@@ -119,6 +123,36 @@
         stateManager.getReferenceMapField( DENIALS_INDEX ).removeValue( permission );
     }
 
+    public Collection<Role> getGrantedRoles()
+    {
+        return stateManager.getReferenceMapField( GRANTED_ROLES_INDEX ).getCurrentValues();
+    }
+
+    public void addGrantedRole( Role role )
+    {
+        stateManager.getReferenceMapField( GRANTED_ROLES_INDEX ).addValue( role );
+    }
+
+    public void removeGrantedRole( Role role )
+    {
+        stateManager.getReferenceMapField( GRANTED_ROLES_INDEX ).removeValue( role );
+    }
+
+    public Collection<Role> getDeniedRoles()
+    {
+        return stateManager.getReferenceMapField( DENIED_ROLES_INDEX ).getCurrentValues();
+    }
+
+    public void addDeniedRole( Role role )
+    {
+        stateManager.getReferenceMapField( DENIED_ROLES_INDEX ).addValue( role );
+    }
+
+    public void removeDeniedRole( Role role )
+    {
+        stateManager.getReferenceMapField( DENIED_ROLES_INDEX ).removeValue( role );
+    }
+
     public StateManager getStateManager()
     {
         return stateManager;
@@ -133,5 +167,7 @@
     {
         stateManager.getReferenceMapField( GRANTS_INDEX ).setBackingMap( parentSm.getChildMap(
 Application.PERMISSIONS_INDEX) );
         stateManager.getReferenceMapField( DENIALS_INDEX ).setBackingMap( parentSm.getChildMap(
 Application.PERMISSIONS_INDEX) );
+        stateManager.getReferenceMapField( GRANTED_ROLES_INDEX ).setBackingMap( parentSm.getChildMap(
 Application.ROLES_INDEX) );
+        stateManager.getReferenceMapField( DENIED_ROLES_INDEX ).setBackingMap( parentSm.getChildMap(
 Application.ROLES_INDEX) );
     }
 }

Modified: directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/User.java
URL: http://svn.apache.org/viewvc/directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/User.java?rev=586163&r1=586162&r2=586163&view=diff
==============================================================================
--- directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/User.java
(original)
+++ directory/sandbox/djencks/triplesec-jacc2/admin-api2/src/main/java/org/apache/directory/triplesec/admin/User.java
Thu Oct 18 15:42:28 2007
@@ -28,6 +28,7 @@
 import org.apache.directory.triplesec.admin.persistence.SingleValuedField;
 import org.apache.directory.triplesec.admin.persistence.State;
 import org.apache.directory.triplesec.admin.persistence.StateManager;
+import org.apache.directory.triplesec.admin.persistence.ReferenceMapField;
 
 
 public class User implements PersistenceCapable
@@ -39,6 +40,8 @@
     protected static final int ID_INDEX = 0;
     protected static final int DESCRIPTION_INDEX = 1;
     protected static final int DISABLED_INDEX = 2;
+    protected static final int ROLES_INDEX = 3;
+    protected static final int DEFAULT_ROLES_INDEX = 4;
 
     private StateManager<? extends User> stateManager;
 
@@ -48,6 +51,8 @@
         stateManager.setRdn( new SimpleRdn( "uid", null, "ou=users" ) );
         stateManager.addField( new SingleValuedField<String>( Constants.DESCRIPTION_ID,
null ) );
         stateManager.addField( new SingleValuedField<Boolean>( Constants.TRIPLESEC_DISABLED_ID,
null ) );
+        stateManager.addField( new ReferenceMapField<Permission>( Constants.ROLES_ID,
stateManager ) );
+        stateManager.addField( new ReferenceMapField<Permission>( Constants.DEFAULT_ROLES_ID,
stateManager ) );
 
         stateManager.setState( State.EMPTY );
     }



Mime
View raw message