Author: truong.le
Date: 2009-12-15 23:51:04 -0500 (Tue, 15 Dec 2009)
New Revision: 1022
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
Log:
GTNPORTAL-358: Show wrong edit permission when create new page for portal
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2009-12-16
04:50:09 UTC (rev 1021)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2009-12-16
04:51:04 UTC (rev 1022)
@@ -89,7 +89,7 @@
UIPagePreview uiPagePreview = getChild(UIPagePreview.class);
UIPage uiPage = (UIPage)uiPagePreview.getUIComponent();
UIPortal uiPortal = Util.getUIPortal();
- if (PortalConfig.PORTAL_TYPE.equals(uiPage.getOwnerType()))
+ /*if (PortalConfig.PORTAL_TYPE.equals(uiPage.getOwnerType()))
{
uiPage.setAccessPermissions(uiPortal.getAccessPermissions());
uiPage.setEditPermission(uiPortal.getEditPermission());
@@ -102,7 +102,7 @@
uiPage.setAccessPermissions(new String[]{"*:" + ownerId});
uiPage.setEditPermission(acl.getMakableMT() + ":" + ownerId);
}
-
+ */
UIWizardPageSetInfo uiPageInfo = getChild(UIWizardPageSetInfo.class);
UIPageNodeSelector uiNodeSelector = uiPageInfo.getChild(UIPageNodeSelector.class);
PageNode selectedNode = uiNodeSelector.getSelectedPageNode();
@@ -261,16 +261,19 @@
private void setDefaultPermission(Page page, String ownerType, String ownerId)
{
+ UIPortal uiPortal = Util.getUIPortal();
if (PortalConfig.PORTAL_TYPE.equals(ownerType))
{
- page.setAccessPermissions(new String[]{"Everyone"});
- page.setEditPermission("manager:/platform/administrators");
+ page.setAccessPermissions(uiPortal.getAccessPermissions());
+ page.setEditPermission(uiPortal.getEditPermission());
}
else if (PortalConfig.GROUP_TYPE.equals(ownerType))
{
+ UserACL acl =
Util.getUIPortalApplication().getApplicationComponent(UserACL.class);
+ ownerId = ownerId.startsWith("/") ? ownerId : "/" +
ownerId;
page.setAccessPermissions(new String[]{"*:" + ownerId});
- page.setEditPermission("manager:" + ownerId);
- }
+ page.setEditPermission(acl.getMakableMT() + ":" + ownerId);
+ }
}
public void execute(Event<UIPageCreationWizard> event) throws Exception
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java 2009-12-16
04:50:09 UTC (rev 1021)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java 2009-12-16
04:51:04 UTC (rev 1022)
@@ -445,13 +445,13 @@
public void execute(Event<UIGroupMembershipSelector> event) throws Exception
{
UIPageForm uiForm = event.getSource().getAncestorOfType(UIPageForm.class);
- if
(!uiForm.getUIStringInput(OWNER_TYPE).getValue().equals(PortalConfig.GROUP_TYPE))
+ /*if
(!uiForm.getUIStringInput(OWNER_TYPE).getValue().equals(PortalConfig.GROUP_TYPE))
return;
String editPer =
uiForm.findFirstComponentOfType(UIPermissionSelector.class).getValue();
if (editPer == null || editPer.length() < 1)
return;
String group = editPer.substring(editPer.indexOf("/") + 1);
- uiForm.ownerIdInput.setValue(group);
+ uiForm.ownerIdInput.setValue(group);*/
event.getRequestContext().addUIComponentToUpdateByAjax(uiForm.getParent());
}
}
Show replies by date