Author: hfnukal
Date: 2011-10-21 01:56:49 -0400 (Fri, 21 Oct 2011)
New Revision: 7814
Modified:
epp/portal/branches/EPP_5_2_Branch/
epp/portal/branches/EPP_5_2_Branch/component/
epp/portal/branches/EPP_5_2_Branch/component/portal/
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org/
epp/portal/branches/EPP_5_2_Branch/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardSelectContainer.java
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/
Log:
JBEPP-1082 Gadget permissions are ignored on dashboard
Property changes on: epp/portal/branches/EPP_5_2_Branch
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795:5868
/portal/branches/branch-GTNPORTAL-1592:4868,4894
/portal/branches/branch-GTNPORTAL-1643:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745:5765
/portal/branches/branch-GTNPORTAL-1790:5871
/portal/branches/branch-GTNPORTAL-1822:5943,5952
/portal/branches/branch-GTNPORTAL-1832:6030,6063
/portal/branches/branch-GTNPORTAL-1872:6400,6551
/portal/branches/branch-GTNPORTAL-1921:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963:6904,6915-6916
/portal/branches/decoupled-webos:6214-6243
/portal/branches/gatein-management:6920-6958
/portal/branches/global-portlet-metadata:6298-6384
/portal/branches/site-describability:6171-6235
/portal/branches/xss:7377-7595,7597
/portal/branches/xss-issues:7350-7351,7358
/portal/trunk:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7433,7450,7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795:5868
/portal/branches/branch-GTNPORTAL-1592:4868,4894
/portal/branches/branch-GTNPORTAL-1643:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745:5765
/portal/branches/branch-GTNPORTAL-1790:5871
/portal/branches/branch-GTNPORTAL-1822:5943,5952
/portal/branches/branch-GTNPORTAL-1832:6030,6063
/portal/branches/branch-GTNPORTAL-1872:6400,6551
/portal/branches/branch-GTNPORTAL-1921:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963:6904,6915-6916
/portal/branches/decoupled-webos:6214-6243
/portal/branches/gatein-management:6920-6958
/portal/branches/global-portlet-metadata:6298-6384
/portal/branches/site-describability:6171-6235
/portal/branches/xss:7377-7595,7597
/portal/branches/xss-issues:7350-7351,7358
/portal/trunk:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7433,7450,7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7780
Property changes on: epp/portal/branches/EPP_5_2_Branch/component
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component:5868
/portal/branches/branch-GTNPORTAL-1592/component:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component:5765
/portal/branches/branch-GTNPORTAL-1790/component:5871
/portal/branches/branch-GTNPORTAL-1822/component:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component:6904,6915-6916
/portal/trunk/component:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component:5868
/portal/branches/branch-GTNPORTAL-1592/component:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component:5765
/portal/branches/branch-GTNPORTAL-1790/component:5871
/portal/branches/branch-GTNPORTAL-1822/component:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component:6904,6915-6916
/portal/trunk/component:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7780
Property changes on: epp/portal/branches/EPP_5_2_Branch/component/portal
___________________________________________________________________
Modified: svn:mergeinfo
- /portal/branches/branch-GTNPORTAL-1592/component/portal:4868
/portal/trunk:7451
/portal/trunk/component/portal:7085,7451,7500,7570-7571,7573,7577,7614-7615
+ /portal/branches/branch-GTNPORTAL-1592/component/portal:4868
/portal/trunk:7451
/portal/trunk/component/portal:7085,7451,7500,7570-7571,7573,7577,7614-7615,7780
Property changes on:
epp/portal/branches/EPP_5_2_Branch/component/portal/src/main/java/org
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615
/portal/trunk/src/main/java/org:7451
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component/portal/src/main/java/org:5868
/portal/branches/branch-GTNPORTAL-1592/component/portal/src/main/java/org:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component/portal/src/main/java/org:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component/portal/src/main/java/org:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component/portal/src/main/java/org:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component/portal/src/main/java/org:5765
/portal/branches/branch-GTNPORTAL-1790/component/portal/src/main/java/org:5871
/portal/branches/branch-GTNPORTAL-1822/component/portal/src/main/java/org:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component/portal/src/main/java/org:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component/portal/src/main/java/org:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component/portal/src/main/java/org:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component/portal/src/main/java/org:6904,6915-6916
/portal/trunk/component/portal/src/main/java/org:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7780
/portal/trunk/src/main/java/org:7451
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardSelectContainer.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardSelectContainer.java 2011-10-21
05:35:36 UTC (rev 7813)
+++
epp/portal/branches/EPP_5_2_Branch/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardSelectContainer.java 2011-10-21
05:56:49 UTC (rev 7814)
@@ -22,12 +22,15 @@
import org.exoplatform.application.registry.Application;
import org.exoplatform.application.registry.ApplicationCategory;
import org.exoplatform.application.registry.ApplicationRegistryService;
+import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.model.ApplicationType;
+import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.core.UIContainer;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
@@ -59,21 +62,28 @@
public final List<ApplicationCategory> getCategories() throws Exception
{
ApplicationRegistryService service =
getApplicationComponent(ApplicationRegistryService.class);
+ UserACL acl =
Util.getUIPortalApplication().getApplicationComponent(UserACL.class);
String remoteUser =
((WebuiRequestContext)WebuiRequestContext.getCurrentInstance()).getRemoteUser();
- List<ApplicationCategory> listCategories =
- service.getApplicationCategories(remoteUser, ApplicationType.GADGET);
+ List<ApplicationCategory> listCategories = new
ArrayList<ApplicationCategory>();
- Iterator<ApplicationCategory> appCateIte = listCategories.iterator();
+ Iterator<ApplicationCategory> appCateIte =
service.getApplicationCategories(remoteUser, ApplicationType.GADGET).iterator();
while (appCateIte.hasNext())
{
ApplicationCategory cate = appCateIte.next();
- List<Application> listGadgets = cate.getApplications();
- if (listGadgets == null || listGadgets.size() == 0)
+ for(String p : cate.getAccessPermissions())
{
- appCateIte.remove();
- continue;
+ if(acl.hasPermission(p))
+ {
+ List<Application> listGadgets = cate.getApplications();
+ if (listGadgets != null && listGadgets.size() > 0)
+ {
+ listCategories.add(cate);
+ break;
+ }
+ }
}
+
}
Collections.sort(listCategories, new Comparator<ApplicationCategory>()
{
@@ -93,7 +103,21 @@
public List<Application> getGadgetsOfCategory(final ApplicationCategory
appCategory) throws Exception
{
- List<Application> listGadgets = appCategory.getApplications();
+ UserACL acl =
Util.getUIPortalApplication().getApplicationComponent(UserACL.class);
+ List<Application> listGadgets = new ArrayList<Application>();
+ Iterator<Application> gadgetIterator =
appCategory.getApplications().iterator();
+ while(gadgetIterator.hasNext())
+ {
+ Application app = gadgetIterator.next();
+ for(String p : app.getAccessPermissions())
+ {
+ if(acl.hasPermission(p))
+ {
+ listGadgets.add(app);
+ break;
+ }
+ }
+ }
Collections.sort(listGadgets, new Comparator<Application>()
{
public int compare(Application app1, Application app2)
Property changes on: epp/portal/branches/EPP_5_2_Branch/wsrp-integration
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/wsrp-integration:5868
/portal/branches/branch-GTNPORTAL-1592/wsrp-integration:4868,4894
/portal/branches/branch-GTNPORTAL-1643/wsrp-integration:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/wsrp-integration:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/wsrp-integration:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/wsrp-integration:5765
/portal/branches/branch-GTNPORTAL-1790/wsrp-integration:5871
/portal/branches/branch-GTNPORTAL-1822/wsrp-integration:5943,5952
/portal/branches/branch-GTNPORTAL-1832/wsrp-integration:6030,6063
/portal/branches/branch-GTNPORTAL-1872/wsrp-integration:6400,6551
/portal/branches/branch-GTNPORTAL-1921/wsrp-integration:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/wsrp-integration:6904,6915-6916
/portal/branches/decoupled-webos/wsrp-integration:6214-6243
/portal/branches/gatein-management/wsrp-integration:6920-6958
/portal/branches/global-portlet-metadata/wsrp-integration:6298-6384
/portal/branches/site-describability/wsrp-integration:6171-6235
/portal/trunk/wsrp-integration:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/wsrp-integration:5868
/portal/branches/branch-GTNPORTAL-1592/wsrp-integration:4868,4894
/portal/branches/branch-GTNPORTAL-1643/wsrp-integration:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/wsrp-integration:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/wsrp-integration:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/wsrp-integration:5765
/portal/branches/branch-GTNPORTAL-1790/wsrp-integration:5871
/portal/branches/branch-GTNPORTAL-1822/wsrp-integration:5943,5952
/portal/branches/branch-GTNPORTAL-1832/wsrp-integration:6030,6063
/portal/branches/branch-GTNPORTAL-1872/wsrp-integration:6400,6551
/portal/branches/branch-GTNPORTAL-1921/wsrp-integration:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/wsrp-integration:6904,6915-6916
/portal/branches/decoupled-webos/wsrp-integration:6214-6243
/portal/branches/gatein-management/wsrp-integration:6920-6958
/portal/branches/global-portlet-metadata/wsrp-integration:6298-6384
/portal/branches/site-describability/wsrp-integration:6171-6235
/portal/trunk/wsrp-integration:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7780