Author: ndkhoiits
Date: 2010-06-11 02:47:02 -0400 (Fri, 11 Jun 2010)
New Revision: 3299
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
Log:
GTNPORTAL-1296 Check permission in server side with some actions by manually from user
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-11
06:43:48 UTC (rev 3298)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2010-06-11
06:47:02 UTC (rev 3299)
@@ -109,10 +109,7 @@
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))
+ if (!hasPageCreationPermission())
{
uiApp.addMessage(new
ApplicationMessage("UIPortalManagement.msg.Invalid-CreatePage-Permission",
null));
return;
@@ -136,6 +133,19 @@
uiPageSetInfo.setShowPublicationDate(false);
event.getRequestContext().addUIComponentToUpdateByAjax(uiWorkingWS);
}
+
+ private boolean hasPageCreationPermission() throws Exception
+ {
+ UIPortal currentPortal = Util.getUIPortal();
+ UserACL userACL =
Util.getUIPortalApplication().getApplicationComponent(UserACL.class);
+ PageNavigation selectedNavigation = currentPortal.getSelectedNavigation();
+ if (PortalConfig.PORTAL_TYPE.equals(selectedNavigation.getOwnerType()))
+ {
+ return userACL.hasEditPermissionOnPortal(currentPortal.getOwnerType(),
currentPortal.getOwner(), currentPortal.getEditPermission());
+ }
+
+ return userACL.hasEditPermission(selectedNavigation);
+ }
}
static public class EditInlineActionListener extends
EventListener<UIWorkingWorkspace>
Show replies by date