portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r412807 - in /portals/jetspeed-2/trunk/applications/j2-admin/src: java/org/apache/jetspeed/portlets/security/permissions/SecurityPermissionsPortlet.java webapp/WEB-INF/security/permissions/view.vm
Date Thu, 08 Jun 2006 17:30:35 GMT
Author: taylor
Date: Thu Jun  8 10:30:35 2006
New Revision: 412807

URL: http://svn.apache.org/viewvc?rev=412807&view=rev
Log:
provide all roles 

Modified:
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/permissions/SecurityPermissionsPortlet.java
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/permissions/SecurityPermissionsPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/permissions/SecurityPermissionsPortlet.java?rev=412807&r1=412806&r2=412807&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/permissions/SecurityPermissionsPortlet.java
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/security/permissions/SecurityPermissionsPortlet.java
Thu Jun  8 10:30:35 2006
@@ -33,6 +33,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.CommonPortletServices;
 import org.apache.jetspeed.security.PermissionManager;
+import org.apache.jetspeed.security.RoleManager;
 import org.apache.jetspeed.security.om.InternalPermission;
 import org.apache.jetspeed.security.om.InternalPrincipal;
 import org.apache.portals.gems.dojo.AbstractDojoVelocityPortlet;
@@ -48,6 +49,7 @@
 {
     protected final Log logger = LogFactory.getLog(this.getClass());
     protected PermissionManager pm = null;
+    protected RoleManager rm = null;
     
     // TODO: move to prefs
     static final String CLASSNAMES[] = 
@@ -73,6 +75,11 @@
         if (pm == null)
                 throw new PortletException(
                         "Could not get instance of portal permission manager component");
+        rm = (RoleManager) context
+                .getAttribute(CommonPortletServices.CPS_ROLE_MANAGER_COMPONENT);
+        if (rm == null)
+            throw new PortletException(
+                "Could not get instance of portal role manager component");        
     }
 
     protected void includeDojoRequires(StringBuffer headerInfoText)
@@ -98,9 +105,11 @@
 
     public void retrievePermissions(PortletSession session, Context context)
     {
+        // TODO: don't use session, since this is a client-side portlet
         Iterator folderPermissions = (Iterator)session.getAttribute("folderPermissions",
PortletSession.PORTLET_SCOPE);
         Iterator pagePermissions = (Iterator)session.getAttribute("pagePermissions", PortletSession.PORTLET_SCOPE);
         Iterator portletPermissions = (Iterator)session.getAttribute("portletPermissions",
PortletSession.PORTLET_SCOPE);
+        Iterator roles = (Iterator)session.getAttribute("roles", PortletSession.PORTLET_SCOPE);
         if (portletPermissions == null)
         {
             List folders = new LinkedList();
@@ -125,11 +134,20 @@
             }
             folderPermissions = folders.iterator();
             pagePermissions = pages.iterator();
-            portletPermissions = portlets.iterator();            
+            portletPermissions = portlets.iterator();
+            try
+            {
+                roles = rm.getRoles("");
+            }
+            catch(Exception e)
+            {
+                logger.error(e);
+            }
         }        
         context.put("folderPermissions", folderPermissions);
         context.put("pagePermissions", pagePermissions);
         context.put("portletPermissions", portletPermissions);
+        context.put("roles", roles);
     }
     
     public void processAction(ActionRequest request,

Modified: portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm?rev=412807&r1=412806&r2=412807&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm
(original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/security/permissions/view.vm
Thu Jun  8 10:30:35 2006
@@ -128,19 +128,10 @@
 
         <div dojoType="Tree" publishSelectionTopic="treeSelected" toggle="fade"
              sizeMin="20" sizeShare="20">
-            <div dojoType="TreeNode" title="Item 1">
-                <div dojoType="TreeNode" title="Item 1.1"><br/></div> 
-                <div dojoType="TreeNode" title="Item 1.2">
-                    <div dojoType="TreeNode" title="Item 1.2.1"></div>
-                    <div dojoType="TreeNode" title="Item 1.2.2"></div>
-                </div>
-                <div dojoType="TreeNode" title="Item 1.3">
-                    <div dojoType="TreeNode" title="Item 1.3.1"></div>
-                    <div dojoType="TreeNode" title="Item 1.3.2"></div>
-                </div>
-                <div dojoType="TreeNode" title="Item 1.4">
-                    <div dojoType="TreeNode" title="Item 1.4.1"></div>
-                </div>
+            <div dojoType="TreeNode" title="Roles">
+#foreach ($role in $roles)            
+                <div dojoType="TreeNode" title="$role.Principal.Name"><br/></div>

+#end                
             </div>
         </div>
 



---------------------------------------------------------------------
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