portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r908108 - in /portals/jetspeed-2/applications/j2-admin/trunk/src/main: java/org/apache/jetspeed/portlets/spaces/ resources/org/apache/jetspeed/portlets/spaces/resources/ webapp/WEB-INF/view/spaces/
Date Tue, 09 Feb 2010 16:29:17 GMT
Author: woonsan
Date: Tue Feb  9 16:29:16 2010
New Revision: 908108

URL: http://svn.apache.org/viewvc?rev=908108&view=rev
Log:
JS2-1057: Authorizing to admin role and the owner

Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/spaces-manager.jsp

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java?rev=908108&r1=908107&r2=908108&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/spaces/SpaceNavigator.java
Tue Feb  9 16:29:16 2010
@@ -95,7 +95,7 @@
         SpaceChangeContext scc = changeSpace(request, spacesService, spaceName);
         request.setAttribute(SpaceNavigator.ATTRIBUTE_SPACE, scc.getSpace());
         request.setAttribute(SpaceNavigator.ATTRIBUTE_SPACES, scc.getSpaces());
-        request.setAttribute(SpaceNavigator.ATTRIBUTE_IS_SPACES_ADMIN, isSpacesAdmin(request)
? Boolean.TRUE : Boolean.FALSE);
+        request.setAttribute(SpaceNavigator.ATTRIBUTE_IS_SPACES_ADMIN, isSpacesAdmin(request,
scc.getSpace()) ? Boolean.TRUE : Boolean.FALSE);
         super.doView(request, response);
     }
     
@@ -158,9 +158,19 @@
         return space;
     }
     
-    protected boolean isSpacesAdmin(PortletRequest request)
+    protected boolean isSpacesAdmin(PortletRequest request, SpaceBean spaceBean)
     {
-        return request.isUserInRole(portalConfig.getString(PortalConfigurationConstants.ROLES_DEFAULT_ADMIN,
"admin"));
+        if (request.isUserInRole(portalConfig.getString(PortalConfigurationConstants.ROLES_DEFAULT_ADMIN,
"admin")))
+        {
+            return true;
+        }
+        
+        if (request.getUserPrincipal() != null && request.getUserPrincipal().getName().equals(spaceBean.getOwner()))
+        {
+            return true;
+        }
+        
+        return false;
     }
     
     protected static SpaceBean findSpace(List<SpaceBean> spaces, String spaceName)

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties?rev=908108&r1=908107&r2=908108&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/spaces/resources/SpacesResources.properties
Tue Feb  9 16:29:16 2010
@@ -33,5 +33,5 @@
 spaces.label.cancel = Cancel
 
 spaces.pages.label.add = Add Page
-spaces.pages.label.space.title = {0} Space
+spaces.pages.label.space.title = {0}
 spaces.pages.label.template = Template

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/spaces-manager.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/spaces-manager.jsp?rev=908108&r1=908107&r2=908108&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/spaces-manager.jsp
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/spaces/spaces-manager.jsp
Tue Feb  9 16:29:16 2010
@@ -55,9 +55,7 @@
           </tr>
           <tr>
             <td class="portlet-section-subheader"><fmt:message key="spaces.label.description"/></td>
-            <td class="portlet-section-subheader">
-              <textarea name="spaceDescription" rows="4" cols="60">${space.description}</textarea>
-            </td>
+            <td class="portlet-section-subheader"><input type="text" name="spaceDescription"
size="30" value="${space.description}"/></td>
           </tr>
           <tr>
             <td class="portlet-section-subheader"><fmt:message key="spaces.label.security"/></td>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message