Author: ndkhoiits
Date: 2010-06-09 03:42:17 -0400 (Wed, 09 Jun 2010)
New Revision: 3273
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
Log:
GTNPORTAL-1269 Check permission in server side when user invoke an action by manually
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-06-09
07:39:22 UTC (rev 3272)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-06-09
07:42:17 UTC (rev 3273)
@@ -748,6 +748,7 @@
UIPortalManagement.msg.Invalid-EditLayout-Permission=You have no right to edit this
layout.
UIPortalManagement.msg.Invalid-EditPage-Permission=You have no right to edit this page.
+UIPortalManagement.msg.Invalid-CreatePage-Permission=You have no right to create new
page.
UIPortalManagement.title.EDIT=Edit current Portal
UIPortalManagement.title.BROWSE=Manage Portals
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2010-06-09
07:39:22 UTC (rev 3272)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2010-06-09
07:42:17 UTC (rev 3273)
@@ -706,6 +706,7 @@
UIPortalManagement.msg.Invalid-EditLayout-Permission=Vous n'avez pas le droit de
modifier cette disposition.
UIPortalManagement.msg.Invalid-EditPage-Permission=Vous n'avez pas le droit de
modifier cette page.
+UIPortalManagement.msg.Invalid-CreatePage-Permission=Vous n'avez pas le droit de
créer un nouveau page.
UIPortalManagement.title.EDIT=Editer le portail en cours
UIPortalManagement.title.BROWSE=Parcourir les portails existants
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2010-06-09
07:39:22 UTC (rev 3272)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2010-06-09
07:42:17 UTC (rev 3273)
@@ -718,6 +718,7 @@
UIPortalManagement.msg.Invalid-EditLayout-Permission=B\u1EA1n kh\u00F4ng c\u00F3
quy\u1EC1n ch\u1EC9nh s\u1EEDa layout.
UIPortalManagement.msg.Invalid-EditPage-Permission=B\u1EA1n kh\u00F4ng c\u00F3 quy\u1EC1n
ch\u1EC9nh s\u1EEDa trang n\u00E0y.
+UIPortalManagement.msg.Invalid-CreatePage-Permission=Bạn không có quyền tạo trang mới.
UIPortalManagement.title.EDIT=Chỉnh sửa Portal hiện tại
UIPortalManagement.title.BROWSE=Khảo sát các Portal
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2010-06-09
07:39:22 UTC (rev 3272)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2010-06-09
07:42:17 UTC (rev 3273)
@@ -24,6 +24,7 @@
import org.exoplatform.portal.config.UserPortalConfig;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.webui.page.UIPage;
import org.exoplatform.portal.webui.page.UIPageBody;
@@ -107,6 +108,16 @@
UIPortalApplication uiApp = Util.getUIPortalApplication();
uiApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
UIWorkingWorkspace uiWorkingWS =
uiApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
+
+ UIPortal currentPortal = Util.getUIPortal();
+ PageNavigation selectedNavigation = currentPortal.getSelectedNavigation();
+ UserACL userACL = uiApp.getApplicationComponent(UserACL.class);
+ if (!userACL.hasEditPermission(selectedNavigation))
+ {
+ uiApp.addMessage(new
ApplicationMessage("UIPortalManagement.msg.Invalid-CreatePage-Permission",
null));
+ return;
+ }
+
uiWorkingWS.setRenderedChild(UIEditInlineWorkspace.class);
UIPortalComposer portalComposer =
uiWorkingWS.findFirstComponentOfType(UIPortalComposer.class);