You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by mo...@apache.org on 2003/02/19 18:39:49 UTC
cvs commit: jakarta-jetspeed/xdocs changes.xml security.xml
morciuch 2003/02/19 09:39:48
Modified: docs/site changes.html security.html
src/java/org/apache/jetspeed/modules/actions/portlets
CustomizeSetAction.java
src/java/org/apache/jetspeed/modules/parameters
RegistryEntryListBox.java
src/java/org/apache/jetspeed/services PortalToolkit.java
src/java/org/apache/jetspeed/services/portaltoolkit
JetspeedPortalToolkitService.java
PortalToolkitService.java
webapp/WEB-INF/conf JetspeedResources.properties
webapp/WEB-INF/templates/vm/parameters/html
RegistryEntryListBox.vm
xdocs changes.xml security.xml
Log:
Added feature to automatically assign a default security constraint to new portal resources (see Bugzilla bug# 16143).
Default security refs are as follows:
user = owner-only
anon = anon-view_admin-all
role = (none)
group = (none)
Revision Changes Path
1.111 +9 -2 jakarta-jetspeed/docs/site/changes.html
Index: changes.html
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/docs/site/changes.html,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- changes.html 13 Feb 2003 08:06:30 -0000 1.110
+++ changes.html 19 Feb 2003 17:39:45 -0000 1.111
@@ -5,7 +5,6 @@
<!-- start the processing -->
<!-- ====================================================================== -->
- <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
<!-- Main Page Section -->
<!-- ====================================================================== -->
<html>
@@ -15,7 +14,6 @@
-
<title>Jetspeed - Jetspeed Changes Log</title>
</head>
@@ -135,6 +133,12 @@
</li>
-->
<li>
+ Fixed - Bug # 16143 - 2003/02/18 - Added functionality to define default security constraint for new portal resources (MO)
+</li>
+<li>
+ Fixed - Bug # 16976 - 2003/02/12 - Fixed Export/Import All only displaying the last message (MO)
+</li>
+<li>
Add - 2003/02/12 - New Skin Browser with Color Selector from Jeremy Ford (DST)
</li>
<li>
@@ -170,6 +174,9 @@
</li>
<li>
Fixed - Bug # 16819 - 2003/02/08 - Fixed pane ordering bug in the customizer (MO)
+</li>
+<li>
+ Fixed - Bug # 16608 - 2003/02/05 - Fixed problem with JspPortletAction.build*Context not being invoked after executeEvents (MO)
</li>
<li>
Fixed - Bug # 16443 - 2003/02/05 - Reimplemented setTemplate method in JspPortletAction to utilize session (MO)
1.15 +85 -40 jakarta-jetspeed/docs/site/security.html
Index: security.html
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/docs/site/security.html,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- security.html 4 Jan 2003 13:41:55 -0000 1.14
+++ security.html 19 Feb 2003 17:39:45 -0000 1.15
@@ -5,7 +5,6 @@
<!-- start the processing -->
<!-- ====================================================================== -->
- <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
<!-- Main Page Section -->
<!-- ====================================================================== -->
<html>
@@ -15,7 +14,6 @@
-
<title>Jetspeed - Security Configuration</title>
</head>
@@ -129,6 +127,7 @@
<li><a href="#Security Implementations">Security Implementations</a></li>
<li><a href="#Registry Access Control">Registry Access Control</a></li>
<li><a href="#Extending Jetspeed User">Extending Jetspeed User</a></li>
+ <li><a href="#Configuring Default Security Constraints">Configuring Default Security Constraints</a></li>
</ul>
</blockquote>
</p>
@@ -148,16 +147,16 @@
</p>
<table>
<tr>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Interface
</font>
-</th>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+</td>
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Description
</font>
-</th>
+</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
@@ -253,16 +252,16 @@
</p>
<table>
<tr>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Interface
</font>
-</th>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+</td>
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Description
</font>
-</th>
+</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
@@ -336,16 +335,16 @@
</p>
<table>
<tr>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Default Implementation
</font>
-</th>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+</td>
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Description
</font>
-</th>
+</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
@@ -624,16 +623,16 @@
</td>
</tr>
<tr>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Attribute
</font>
-</th>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+</td>
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Description
</font>
-</th>
+</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
@@ -658,16 +657,16 @@
</td>
</tr>
<tr>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Element
</font>
-</th>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+</td>
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Description
</font>
-</th>
+</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
@@ -692,16 +691,16 @@
</td>
</tr>
<tr>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Attribute
</font>
-</th>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+</td>
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Description
</font>
-</th>
+</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
@@ -726,16 +725,16 @@
</td>
</tr>
<tr>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Element
</font>
-</th>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+</td>
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Description
</font>
-</th>
+</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
@@ -772,16 +771,16 @@
</td>
</tr>
<tr>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Attribute
</font>
-</th>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+</td>
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Description
</font>
-</th>
+</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
@@ -811,21 +810,21 @@
</td>
</tr>
<tr>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Icon
</font>
-</th>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+</td>
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Action
</font>
-</th>
- <th bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
+</td>
+ <td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Description
</font>
-</th>
+</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
@@ -1032,6 +1031,52 @@
</ul>
<p>
For an overview of modifying Torque schemas, see: <a href="http://jakarta.apache.org/turbine/torque/schema-reference.html">Torque Schemas</a>
+</p>
+ </blockquote>
+ </p>
+ </td></tr>
+ <tr><td><br/></td></tr>
+ </table>
+ <table border="0" cellspacing="0" cellpadding="2" width="100%">
+ <tr><td bgcolor="#525D76">
+ <font color="#ffffff" face="arial,helvetica,sanserif">
+ <a name="Configuring Default Security Constraints"><strong>Configuring Default Security Constraints</strong></a>
+ </font>
+ </td></tr>
+ <tr><td>
+ <blockquote>
+ <p>
+When new portal resources are created, it is possible to automatically assign a default security constraint. The following
+settings in JetspeedSecurity.properties control this feature (shown here with default values):
+</p>
+ <div align="left">
+ <table cellspacing="4" cellpadding="0" border="0">
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#ffffff"><pre>
+services.PortalToolkit.default.user.security.ref = owner-only
+services.PortalToolkit.default.anon.security.ref = anon-view_admin-all
+services.PortalToolkit.default.role.security.ref =
+services.PortalToolkit.default.group.security.ref =
+</pre></td>
+ <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
+ </tr>
+ </table>
+ </div>
+ <p>
+For example, when user creates new pane, the security ref for the pane will be automatically set to "owner-only". When new portlet is
+added, its security ref will also be set to "owner-only". Also, selecting "-- Default --" will now set the security ref to "owner-only".
+Care must be taken with the anonymous profile as "owner-only" is not an appropriate security constraint here.
</p>
</blockquote>
</p>
1.39 +21 -1 jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/CustomizeSetAction.java
Index: CustomizeSetAction.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/actions/portlets/CustomizeSetAction.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- CustomizeSetAction.java 21 Jan 2003 20:43:35 -0000 1.38
+++ CustomizeSetAction.java 19 Feb 2003 17:39:45 -0000 1.39
@@ -494,6 +494,16 @@
p.setMetaInfo(new PsmlMetaInfo());
p.getMetaInfo().setTitle(title);
p.setId(JetspeedIdGenerator.getNextPeid());
+ SecurityReference defaultRef = PortalToolkit.getDefaultSecurityRef(
+ ((JetspeedRunData) rundata).getCustomizedProfile());
+ if (defaultRef != null)
+ {
+ if (Log.getLogger().isDebugEnabled())
+ {
+ Log.debug("CustomizeSetAction: setting default portlet set security to [" + defaultRef.getParent() + "]");
+ }
+ p.setSecurityRef(defaultRef);
+ }
portlets.addPortlets(p);
}
}
@@ -666,6 +676,16 @@
p.setParent(pnames[i]);
p.setId(JetspeedIdGenerator.getNextPeid());
+ SecurityReference defaultRef = PortalToolkit.getDefaultSecurityRef(
+ ((JetspeedRunData) rundata).getCustomizedProfile());
+ if (defaultRef != null)
+ {
+ if (Log.getLogger().isDebugEnabled())
+ {
+ Log.debug("CustomizeSetAction: setting default portlet security to [" + defaultRef.getParent() + "]");
+ }
+ p.setSecurityRef(defaultRef);
+ }
portlets.addEntry(p);
}
}
1.4 +13 -1 jakarta-jetspeed/src/java/org/apache/jetspeed/modules/parameters/RegistryEntryListBox.java
Index: RegistryEntryListBox.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/parameters/RegistryEntryListBox.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RegistryEntryListBox.java 21 Nov 2002 23:49:41 -0000 1.3
+++ RegistryEntryListBox.java 19 Feb 2003 17:39:45 -0000 1.4
@@ -66,12 +66,16 @@
import org.apache.jetspeed.om.registry.RegistryEntry;
import org.apache.jetspeed.om.registry.Parameter;
import org.apache.jetspeed.om.security.JetspeedUser;
+import org.apache.jetspeed.om.SecurityReference;
import org.apache.jetspeed.services.JetspeedSecurity;
import org.apache.jetspeed.services.Registry;
import org.apache.jetspeed.services.rundata.JetspeedRunData;
import org.apache.jetspeed.services.security.PortalResource;
+import org.apache.jetspeed.services.PortalToolkit;
+
import org.apache.turbine.services.localization.Localization;
import org.apache.turbine.util.RunData;
+
import org.apache.velocity.context.Context;
/**
@@ -121,6 +125,7 @@
boolean setLabel = (new Boolean((String)getParm(OPTION_SET_LABEL, "false"))).booleanValue();
boolean disabledIfWML = (new Boolean((String)getParm(OPTION_DISABLED_IF_WML, "false"))).booleanValue();
boolean selectIfSimple = (new Boolean((String)getParm(OPTION_SELECT_IF_SIMPLE, "false"))).booleanValue();
+ String defaultEntry = null;
// Iterate thru entries from selected registry
List list = new ArrayList();
@@ -182,6 +187,12 @@
else if (regName.equals(Registry.SECURITY))
{
label = Localization.getString("CUSTOMIZER_SECURITY_REF");
+ SecurityReference defaultRef = PortalToolkit.getDefaultSecurityRef(
+ ((JetspeedRunData) data).getCustomizedProfile());
+ if (defaultRef != null)
+ {
+ defaultEntry = defaultRef.getParent();
+ }
}
else if (regName.equals(Registry.MEDIA_TYPE))
{
@@ -209,6 +220,7 @@
context.put("label", label);
if (disabledIfWML && mediaType.equalsIgnoreCase("wml"))
context.put("disabled", "disabled");
+ context.put("defaultEntry", defaultEntry);
}
}
1.4 +28 -1 jakarta-jetspeed/src/java/org/apache/jetspeed/services/PortalToolkit.java
Index: PortalToolkit.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/PortalToolkit.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PortalToolkit.java 4 Apr 2002 18:39:49 -0000 1.3
+++ PortalToolkit.java 19 Feb 2003 17:39:45 -0000 1.4
@@ -65,6 +65,8 @@
import org.apache.jetspeed.om.profile.Skin;
import org.apache.jetspeed.services.portaltoolkit.PortalToolkitService;
import org.apache.turbine.services.TurbineServices;
+import org.apache.jetspeed.om.SecurityReference;
+import org.apache.jetspeed.om.profile.Profile;
/**
* Commodity static wrapper around the PortalToolit service
@@ -175,5 +177,30 @@
{
return getService().getReference(locatorPath);
}
+
+ /**
+ * Gets default security ref based on the profile type (user|role|group). Returns
+ * null if no default is defined.
+ *
+ * @param profile
+ * @return default security reference
+ */
+ public static SecurityReference getDefaultSecurityRef(Profile profile)
+ {
+ return getService().getDefaultSecurityRef(profile);
+ }
+
+ /**
+ * Gets default security ref based on the profile type (user|role|group). Returns
+ * null if no default is defined.
+ *
+ * @param type of entity to return default security ref for
+ * @return default security reference
+ */
+ public static SecurityReference getDefaultSecurityRef(String type)
+ {
+ return getService().getDefaultSecurityRef(type);
+ }
+
}
1.27 +128 -6 jakarta-jetspeed/src/java/org/apache/jetspeed/services/portaltoolkit/JetspeedPortalToolkitService.java
Index: JetspeedPortalToolkitService.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/portaltoolkit/JetspeedPortalToolkitService.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- JetspeedPortalToolkitService.java 6 Jan 2003 08:32:06 -0000 1.26
+++ JetspeedPortalToolkitService.java 19 Feb 2003 17:39:45 -0000 1.27
@@ -55,10 +55,31 @@
package org.apache.jetspeed.services.portaltoolkit;
//jetspeed stuff
-import org.apache.jetspeed.portal.*;
-import org.apache.jetspeed.om.profile.*;
+import org.apache.jetspeed.portal.PortletControl;
+import org.apache.jetspeed.portal.PortletController;
+import org.apache.jetspeed.portal.PortletSkin;
+import org.apache.jetspeed.portal.PortletSet;
+import org.apache.jetspeed.portal.Portlet;
+import org.apache.jetspeed.portal.PortletConfig;
+import org.apache.jetspeed.portal.BasePortletConfig;
+import org.apache.jetspeed.portal.PortletControlConfig;
+import org.apache.jetspeed.portal.BasePortletControlConfig;
+import org.apache.jetspeed.portal.PortletControllerConfig;
+import org.apache.jetspeed.portal.BasePortletControllerConfig;
+import org.apache.jetspeed.portal.BasePortletSkin;
+import org.apache.jetspeed.portal.BasePortletSet;
+import org.apache.jetspeed.om.profile.Control;
+import org.apache.jetspeed.om.profile.Controller;
+import org.apache.jetspeed.om.profile.Skin;
+import org.apache.jetspeed.om.profile.Portlets;
+import org.apache.jetspeed.om.profile.Layout;
+import org.apache.jetspeed.om.profile.Profile;
+import org.apache.jetspeed.om.profile.Parameter;
+import org.apache.jetspeed.om.profile.MetaInfo;
+import org.apache.jetspeed.om.profile.Entry;
+import org.apache.jetspeed.om.profile.ProfileLocator;
+import org.apache.jetspeed.om.profile.PSMLDocument;
import org.apache.jetspeed.services.Profiler;
-import org.apache.jetspeed.services.PortalToolkit;
import org.apache.jetspeed.services.Registry;
import org.apache.jetspeed.services.PortletFactory;
@@ -68,6 +89,9 @@
import org.apache.jetspeed.om.registry.SkinEntry;
import org.apache.jetspeed.util.MetaData;
import org.apache.jetspeed.util.JetspeedException;
+import org.apache.jetspeed.om.BaseSecurityReference;
+import org.apache.jetspeed.om.SecurityReference;
+import org.apache.jetspeed.om.registry.SecurityEntry;
import org.apache.turbine.services.TurbineServices;
import org.apache.turbine.services.TurbineBaseService;
@@ -77,7 +101,6 @@
import java.util.Iterator;
-import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Map;
import javax.servlet.ServletConfig;
@@ -87,6 +110,7 @@
*
* @author <a href="mailto:raphael@apache.org">Rapha�l Luta</a>
* @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @author <a href="mailto:morciuch@apache.org">Mark Orciuch</a>
*
* @version $Id$
*/
@@ -103,6 +127,18 @@
/** The default skin to use when none is specified */
private String defaultSkin = null;
+ /** The default user security ref to use when none is specified */
+ private String defaultUserSecurityRef = null;
+
+ /** The default anonymous user security ref to use when none is specified */
+ private String defaultAnonSecurityRef = null;
+
+ /** The default role security ref to use when none is specified */
+ private String defaultRoleSecurityRef = null;
+
+ /** The default group security ref to use when none is specified */
+ private String defaultGroupSecurityRef = null;
+
/**
* This is the early initialization method called by the
* Turbine <code>Service</code> framework
@@ -116,6 +152,10 @@
this.defaultControl = serviceConf.getString("default.control");
this.defaultController = serviceConf.getString("default.controller");
this.defaultSkin = serviceConf.getString("default.skin");
+ this.defaultUserSecurityRef = serviceConf.getString("default.user.security.ref");
+ this.defaultAnonSecurityRef = serviceConf.getString("default.anon.security.ref");
+ this.defaultRoleSecurityRef = serviceConf.getString("default.role.security.ref");
+ this.defaultGroupSecurityRef = serviceConf.getString("default.group.security.ref");
setInit(true);
}
@@ -289,7 +329,7 @@
}
/**
- * Instanciates a PortletController based on a PSML Controller object
+ * Instantiates a PortletController based on a PSML Controller object
*
* @param controller the PSML controller object
* @return the created PortletController
@@ -792,6 +832,88 @@
}
}
+ /**
+ * Gets default security ref based on the profile type (user|role|group). Returns
+ * null if no default is defined.
+ *
+ * @param profile
+ * @return default security reference
+ */
+ public SecurityReference getDefaultSecurityRef(Profile profile)
+ {
+ String type = null;
+ if (profile.getUserName() != null)
+ {
+ if (profile.getAnonymous())
+ {
+ type = Profiler.PARAM_ANON;
+ }
+ else
+ {
+ type = Profiler.PARAM_USER;
+ }
+ }
+ else if (profile.getRoleName() != null)
+ {
+ type = Profiler.PARAM_ROLE;
+ }
+ else if (profile.getGroupName() != null)
+ {
+ type = Profiler.PARAM_GROUP;
+ }
+
+ return getDefaultSecurityRef(type);
+
+ }
+
+ /**
+ * Gets default security ref based on the profile type (user|role|group). Returns
+ * null if no default is defined.
+ *
+ * @param type of entity to return default security ref for
+ * @return default security reference
+ */
+ public SecurityReference getDefaultSecurityRef(String type)
+ {
+ BaseSecurityReference result = null;
+ SecurityEntry entry = null;
+
+ String defaultRef = null;
+ if (type.equals(Profiler.PARAM_USER))
+ {
+ defaultRef = this.defaultUserSecurityRef;
+ }
+ else if (type.equals(Profiler.PARAM_ANON))
+ {
+ defaultRef = this.defaultAnonSecurityRef;
+ }
+ else if (type.equals(Profiler.PARAM_ROLE))
+ {
+ defaultRef = this.defaultRoleSecurityRef;
+ }
+ else if (type.equals(Profiler.PARAM_GROUP))
+ {
+ defaultRef = this.defaultGroupSecurityRef;
+ }
+
+ entry = (SecurityEntry) Registry.getEntry(Registry.SECURITY, defaultRef);
+ if (Log.getLogger().isDebugEnabled())
+ {
+ Log.debug("JetspeedPortalToolkit: default security for type: " + type + " is " + defaultRef);
+ }
+ if (entry != null)
+ {
+ result = new BaseSecurityReference();
+ result.setParent(entry.getName());
+ if (Log.getLogger().isDebugEnabled())
+ {
+ Log.debug("JetspeedPortalToolkit: default security for type: " + type + " was set to " + entry.getName());
+ }
+ }
+
+ return result;
+
+ }
}
1.4 +22 -2 jakarta-jetspeed/src/java/org/apache/jetspeed/services/portaltoolkit/PortalToolkitService.java
Index: PortalToolkitService.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/portaltoolkit/PortalToolkitService.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PortalToolkitService.java 4 Apr 2002 18:39:49 -0000 1.3
+++ PortalToolkitService.java 19 Feb 2003 17:39:45 -0000 1.4
@@ -64,7 +64,9 @@
import org.apache.jetspeed.om.profile.Portlets;
import org.apache.jetspeed.om.profile.Skin;
import org.apache.turbine.services.Service;
-
+import org.apache.jetspeed.om.SecurityReference;
+import org.apache.jetspeed.om.profile.Profile;
+
/**
* This service is a Factory for creating new Portal objects from
* named Registry entries or PSML configuration entries.
@@ -146,6 +148,24 @@
* @return a portlets collection from the PSML resource
*/
public Portlets getReference(String locatorPath);
+
+ /**
+ * Gets default security ref based on the profile type (user|role|group). Returns
+ * null if no default is defined.
+ *
+ * @param profile
+ * @return default security reference
+ */
+ public SecurityReference getDefaultSecurityRef(Profile profile);
+
+ /**
+ * Gets default security ref based on the profile type (user|role|group). Returns
+ * null if no default is defined.
+ *
+ * @param type of entity to return default security ref for
+ * @return default security reference
+ */
+ public SecurityReference getDefaultSecurityRef(String type);
}
1.94 +5 -1 jakarta-jetspeed/webapp/WEB-INF/conf/JetspeedResources.properties
Index: JetspeedResources.properties
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/conf/JetspeedResources.properties,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- JetspeedResources.properties 22 Nov 2002 17:00:50 -0000 1.93
+++ JetspeedResources.properties 19 Feb 2003 17:39:46 -0000 1.94
@@ -384,6 +384,10 @@
services.PortalToolkit.default.control=TitlePortletControl
services.PortalToolkit.default.controller=OneColumn
services.PortalToolkit.default.skin=orange-grey
+services.PortalToolkit.default.user.security.ref = owner-only
+services.PortalToolkit.default.anon.security.ref = anon-view_admin-all
+services.PortalToolkit.default.role.security.ref =
+services.PortalToolkit.default.group.security.ref =
#########################################
# Profiler Service #
1.2 +1 -1 jakarta-jetspeed/webapp/WEB-INF/templates/vm/parameters/html/RegistryEntryListBox.vm
Index: RegistryEntryListBox.vm
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/templates/vm/parameters/html/RegistryEntryListBox.vm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RegistryEntryListBox.vm 12 Nov 2002 22:19:00 -0000 1.1
+++ RegistryEntryListBox.vm 19 Feb 2003 17:39:47 -0000 1.2
@@ -1,7 +1,7 @@
## $Id$
$!label
<select name="$name" $!disabled #foreach($event in $events.keySet()) $event="$events.get($event)" #end>
- <option value="">-- Default --
+ <option value="$!defaultEntry">-- Default --
#foreach ($entry in $entries)
<option value="$entry.Name" #if ($entry.Name == $!value) SELECTED #end>
#if ($entry.Title) $entry.Title #else $entry.Name #end
1.128 +10 -1 jakarta-jetspeed/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/xdocs/changes.xml,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -r1.127 -r1.128
--- changes.xml 13 Feb 2003 08:06:30 -0000 1.127
+++ changes.xml 19 Feb 2003 17:39:48 -0000 1.128
@@ -23,6 +23,12 @@
</li>
-->
<li>
+ Fixed - Bug # 16143 - 2003/02/18 - Added functionality to define default security constraint for new portal resources (MO)
+</li>
+<li>
+ Fixed - Bug # 16976 - 2003/02/12 - Fixed Export/Import All only displaying the last message (MO)
+</li>
+<li>
Add - 2003/02/12 - New Skin Browser with Color Selector from Jeremy Ford (DST)
</li>
<li>
@@ -58,6 +64,9 @@
</li>
<li>
Fixed - Bug # 16819 - 2003/02/08 - Fixed pane ordering bug in the customizer (MO)
+</li>
+<li>
+ Fixed - Bug # 16608 - 2003/02/05 - Fixed problem with JspPortletAction.build*Context not being invoked after executeEvents (MO)
</li>
<li>
Fixed - Bug # 16443 - 2003/02/05 - Reimplemented setTemplate method in JspPortletAction to utilize session (MO)
1.7 +19 -0 jakarta-jetspeed/xdocs/security.xml
Index: security.xml
===================================================================
RCS file: /home/cvs/jakarta-jetspeed/xdocs/security.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- security.xml 10 Sep 2002 15:12:08 -0000 1.6
+++ security.xml 19 Feb 2003 17:39:48 -0000 1.7
@@ -5,6 +5,7 @@
<subtitle>Security Configuration</subtitle>
<authors>
<person name="David Sean Taylor" email="taylor@apache.org"/>
+ <person name="Mark Orciuch" email="morciuch@apache.org"/>
</authors>
</properties>
<body>
@@ -14,6 +15,7 @@
<li><a href="#Security Implementations">Security Implementations</a></li>
<li><a href="#Registry Access Control">Registry Access Control</a></li>
<li><a href="#Extending Jetspeed User">Extending Jetspeed User</a></li>
+ <li><a href="#Configuring Default Security Constraints">Configuring Default Security Constraints</a></li>
</ul>
</section>
<section name="Security Overview">
@@ -399,6 +401,23 @@
</ul>
<p>
For an overview of modifying Torque schemas, see: <a href="http://jakarta.apache.org/turbine/torque/schema-reference.html">Torque Schemas</a>
+</p>
+</section>
+<section name="Configuring Default Security Constraints">
+<p>
+When new portal resources are created, it is possible to automatically assign a default security constraint. The following
+settings in JetspeedSecurity.properties control this feature (shown here with default values):
+</p>
+<source>
+services.PortalToolkit.default.user.security.ref = owner-only
+services.PortalToolkit.default.anon.security.ref = anon-view_admin-all
+services.PortalToolkit.default.role.security.ref =
+services.PortalToolkit.default.group.security.ref =
+</source>
+<p>
+For example, when user creates new pane, the security ref for the pane will be automatically set to "owner-only". When new portlet is
+added, its security ref will also be set to "owner-only". Also, selecting "-- Default --" will now set the security ref to "owner-only".
+Care must be taken with the anonymous profile as "owner-only" is not an appropriate security constraint here.
</p>
</section>
</body>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org