taylor 01/07/29 23:45:16
Modified: src/java/org/apache/jetspeed/services JetspeedSecurity.java
src/java/org/apache/jetspeed/services/security
JetspeedDBSecurityService.java
JetspeedSecurityService.java
Log:
- updated Jetspeed Security to create and delete PSML trees when users are
added/removed from JetspeedSecurity
Revision Changes Path
1.7 +40 -1
jakarta-jetspeed/src/java/org/apache/jetspeed/services/JetspeedSecurity.java
Index: JetspeedSecurity.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/JetspeedSecurity.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- JetspeedSecurity.java 2001/07/29 13:41:59 1.6
+++ JetspeedSecurity.java 2001/07/30 06:45:16 1.7
@@ -56,6 +56,8 @@
import org.apache.turbine.services.security.TurbineSecurity;
import org.apache.turbine.om.security.User;
+import org.apache.turbine.om.security.Group;
+import org.apache.turbine.om.security.Role;
import org.apache.jetspeed.services.security.*;
import org.apache.turbine.util.RunData;
import org.apache.jetspeed.om.registry.PortletEntry;
@@ -71,7 +73,7 @@
*
* @see org.apache.jetspeed.services.security.JetspeedSecurityService
* @author <a href="mailto:[EMAIL PROTECTED]">David Sean Taylor</a>
- * @version $Id: JetspeedSecurity.java,v 1.6 2001/07/29 13:41:59 raphael Exp $
+ * @version $Id: JetspeedSecurity.java,v 1.7 2001/07/30 06:45:16 taylor Exp $
*/
abstract public class JetspeedSecurity extends TurbineSecurity
@@ -133,4 +135,41 @@
{
((JetspeedSecurityService)getService()).removeUser(user, data);
}
+
+ /**
+ * @see JetspeedSecurityService#addGroup
+ */
+ public static void addGroup( Group group, RunData data )
+ throws Exception
+ {
+ ((JetspeedSecurityService)getService()).addGroup(group, data);
+ }
+
+ /**
+ * @see JetspeedSecurityService#removeGroup
+ */
+ public static void removeGroup( Group group, RunData data )
+ throws Exception
+ {
+ ((JetspeedSecurityService)getService()).removeGroup(group, data);
+ }
+
+ /**
+ * @see JetspeedSecurityService#addRole
+ */
+ public static void addRole( Role role, RunData data )
+ throws Exception
+ {
+ ((JetspeedSecurityService)getService()).addRole(role, data);
+ }
+
+ /**
+ * @see JetspeedSecurityService#removeRole
+ */
+ public static void removeRole( Role role, RunData data )
+ throws Exception
+ {
+ ((JetspeedSecurityService)getService()).removeRole(role, data);
+ }
+
}
1.10 +92 -1
jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/JetspeedDBSecurityService.java
Index: JetspeedDBSecurityService.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/JetspeedDBSecurityService.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- JetspeedDBSecurityService.java 2001/07/30 03:50:08 1.9
+++ JetspeedDBSecurityService.java 2001/07/30 06:45:16 1.10
@@ -61,6 +61,8 @@
import org.apache.jetspeed.services.Registry;
import org.apache.jetspeed.om.registry.*;
import org.apache.turbine.om.security.User;
+import org.apache.turbine.om.security.Group;
+import org.apache.turbine.om.security.Role;
import org.apache.turbine.util.RunData;
import org.apache.turbine.util.security.AccessControlList;
@@ -81,7 +83,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">David Sean Taylor</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Santiago Gala</a>
- * @version $Id: JetspeedDBSecurityService.java,v 1.9 2001/07/30 03:50:08 taylor
Exp $
+ * @version $Id: JetspeedDBSecurityService.java,v 1.10 2001/07/30 06:45:16 taylor
Exp $
*/
@@ -209,4 +211,93 @@
PsmlManager.removeUserDocuments(user);
removeUser(user);
}
+
+ /**
+ * Adds a group to the backend database.
+ * Creates a default group profile in the PSML directory.
+ *
+ * @param group The Turbine Group object to be added to the database.
+ * @param rundata The request rundata.
+ * @exception Can throw database exceptions or profiler exceptions
+ *
+ */
+ public void addGroup( Group group, RunData data )
+ throws Exception
+ {
+ addGroup(group);
+
+ try
+ {
+ Profile profile = new BaseProfile();
+ profile.setGroup(group);
+ profile.setMediaType("html");
+ Profiler.createProfile(data, profile);
+ }
+ catch (Exception e)
+ {
+ removeGroup(group);
+ throw e;
+ }
+ }
+
+ /**
+ * Removes group from the backend database.
+ * Removes the group's profile in the PSML directory.
+ *
+ * @param group The Turbine Group object to be added to the database.
+ * @param rundata The request rundata.
+ * @exception Can throw database exceptions or profiler exceptions
+ *
+ */
+ public void removeGroup( Group group, RunData data )
+ throws Exception
+ {
+ PsmlManager.removeGroupDocuments(group);
+ removeGroup(group);
+ }
+
+ /**
+ * Adds a role to the backend database.
+ * Creates a default role profile in the PSML directory.
+ *
+ * @param role The Turbine Role object to be added to the database.
+ * @param rundata The request rundata.
+ * @exception Can throw database exceptions or profiler exceptions
+ *
+ */
+ public void addRole( Role role, RunData data )
+ throws Exception
+ {
+ addRole(role);
+
+ try
+ {
+ Profile profile = new BaseProfile();
+ profile.setRole(role);
+ profile.setMediaType("html");
+ Profiler.createProfile(data, profile);
+ }
+ catch (Exception e)
+ {
+ removeRole(role);
+ throw e;
+ }
+ }
+
+ /**
+ * Removes role from the backend database.
+ * Removes the role's profile in the PSML directory.
+ *
+ * @param role The Turbine Role object to be added to the database.
+ * @param rundata The request rundata.
+ * @exception Can throw database exceptions or profiler exceptions
+ *
+ */
+ public void removeRole( Role role, RunData data )
+ throws Exception
+ {
+ PsmlManager.removeRoleDocuments(role);
+ removeRole(role);
+ }
+
}
1.4 +15 -1
jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/JetspeedSecurityService.java
Index: JetspeedSecurityService.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/security/JetspeedSecurityService.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JetspeedSecurityService.java 2001/07/02 07:40:50 1.3
+++ JetspeedSecurityService.java 2001/07/30 06:45:16 1.4
@@ -57,6 +57,8 @@
import org.apache.turbine.services.security.SecurityService;
import org.apache.turbine.om.security.User;
+import org.apache.turbine.om.security.Role;
+import org.apache.turbine.om.security.Group;
import org.apache.turbine.util.RunData;
import org.apache.turbine.util.security.DataBackendException;
import org.apache.turbine.util.security.EntityExistsException;
@@ -71,7 +73,7 @@
* for controlling access to portal resources (portlets, panes).
*
* @author <a href="mailto:[EMAIL PROTECTED]">David Sean Taylor</a>
- * @version $Id: JetspeedSecurityService.java,v 1.3 2001/07/02 07:40:50 taylor Exp $
+ * @version $Id: JetspeedSecurityService.java,v 1.4 2001/07/30 06:45:16 taylor Exp $
*/
@@ -81,6 +83,18 @@
throws Exception;
public void removeUser( User user, RunData data )
+ throws Exception;
+
+ public void addGroup( Group group, RunData data )
+ throws Exception;
+
+ public void removeGroup( Group group, RunData data )
+ throws Exception;
+
+ public void addRole( Role role, RunData data )
+ throws Exception;
+
+ public void removeRole( Role role, RunData data )
throws Exception;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]