Permalink
Browse files

LPS-27356 Adding an asset via Asset Publisher should not require "Go …

…to Control Panel" permission
  • Loading branch information...
1 parent 5fe54db commit 7eedf4cd33eed477b796e39c5146b1de6118b691 @jjangsam committed May 17, 2012
View
2 portal-impl/src/com/liferay/portlet/blogs/asset/BlogsEntryAssetRenderer.java
@@ -102,7 +102,7 @@ public PortletURL getURLEdit(
throws Exception {
PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(
- getControlPanelPlid(liferayPortletRequest), PortletKeys.BLOGS,
+ getPlid(liferayPortletRequest), PortletKeys.BLOGS,
PortletRequest.RENDER_PHASE);
portletURL.setParameter("struts_action", "/blogs/edit_entry");
View
2 portal-impl/src/com/liferay/portlet/blogs/asset/BlogsEntryAssetRendererFactory.java
@@ -94,7 +94,7 @@ public PortletURL getURLAdd(
}
PortletURL portletURL = PortletURLFactoryUtil.create(
- request, PortletKeys.BLOGS, getControlPanelPlid(themeDisplay),
+ request, PortletKeys.BLOGS, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
portletURL.setParameter("struts_action", "/blogs/edit_entry");
View
2 portal-impl/src/com/liferay/portlet/bookmarks/asset/BookmarksEntryAssetRenderer.java
@@ -71,7 +71,7 @@ public PortletURL getURLEdit(
throws Exception {
PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(
- getControlPanelPlid(liferayPortletRequest), PortletKeys.BOOKMARKS,
+ getPlid(liferayPortletRequest), PortletKeys.BOOKMARKS,
PortletRequest.RENDER_PHASE);
portletURL.setParameter("struts_action", "/bookmarks/edit_entry");
View
2 portal-impl/src/com/liferay/portlet/bookmarks/asset/BookmarksEntryAssetRendererFactory.java
@@ -86,7 +86,7 @@ public PortletURL getURLAdd(
}
PortletURL portletURL = PortletURLFactoryUtil.create(
- request, PortletKeys.BOOKMARKS, getControlPanelPlid(themeDisplay),
+ request, PortletKeys.BOOKMARKS, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
portletURL.setParameter("struts_action", "/bookmarks/edit_entry");
View
2 portal-impl/src/com/liferay/portlet/calendar/asset/CalEventAssetRenderer.java
@@ -82,7 +82,7 @@ public PortletURL getURLEdit(
throws Exception {
PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(
- getControlPanelPlid(liferayPortletRequest), PortletKeys.CALENDAR,
+ getPlid(liferayPortletRequest), PortletKeys.CALENDAR,
PortletRequest.RENDER_PHASE);
portletURL.setParameter("struts_action", "/calendar/edit_event");
View
2 portal-impl/src/com/liferay/portlet/calendar/asset/CalEventAssetRendererFactory.java
@@ -83,7 +83,7 @@ public PortletURL getURLAdd(
}
PortletURL portletURL = PortletURLFactoryUtil.create(
- request, PortletKeys.CALENDAR, getControlPanelPlid(themeDisplay),
+ request, PortletKeys.CALENDAR, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
portletURL.setParameter("struts_action", "/calendar/edit_event");
View
4 portal-impl/src/com/liferay/portlet/documentlibrary/asset/DLFileEntryAssetRenderer.java
@@ -125,8 +125,8 @@ public PortletURL getURLEdit(
throws Exception {
PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(
- getControlPanelPlid(liferayPortletRequest),
- PortletKeys.DOCUMENT_LIBRARY, PortletRequest.RENDER_PHASE);
+ getPlid(liferayPortletRequest), PortletKeys.DOCUMENT_LIBRARY,
+ PortletRequest.RENDER_PHASE);
portletURL.setParameter(
"struts_action", "/document_library/edit_file_entry");
View
4 ...l-impl/src/com/liferay/portlet/documentlibrary/asset/DLFileEntryAssetRendererFactory.java
@@ -138,8 +138,8 @@ public PortletURL getURLAdd(
}
PortletURL portletURL = PortletURLFactoryUtil.create(
- request, PortletKeys.DOCUMENT_LIBRARY,
- getControlPanelPlid(themeDisplay), PortletRequest.RENDER_PHASE);
+ request, PortletKeys.DOCUMENT_LIBRARY, themeDisplay.getPlid(),
+ PortletRequest.RENDER_PHASE);
portletURL.setParameter(
"struts_action", "/document_library/edit_file_entry");
View
2 portal-impl/src/com/liferay/portlet/journal/asset/JournalArticleAssetRenderer.java
@@ -105,7 +105,7 @@ public PortletURL getURLEdit(
throws Exception {
PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(
- getControlPanelPlid(liferayPortletRequest), PortletKeys.JOURNAL,
+ getPlid(liferayPortletRequest), PortletKeys.JOURNAL,
PortletRequest.RENDER_PHASE);
portletURL.setParameter("struts_action", "/journal/edit_article");
View
2 portal-impl/src/com/liferay/portlet/journal/asset/JournalArticleAssetRendererFactory.java
@@ -169,7 +169,7 @@ public PortletURL getURLAdd(
}
PortletURL portletURL = PortletURLFactoryUtil.create(
- request, PortletKeys.JOURNAL, getControlPanelPlid(themeDisplay),
+ request, PortletKeys.JOURNAL, themeDisplay.getPlid(),
PortletRequest.RENDER_PHASE);
portletURL.setParameter("struts_action", "/journal/edit_article");
View
2 portal-impl/src/com/liferay/portlet/wiki/asset/WikiPageAssetRenderer.java
@@ -100,7 +100,7 @@ public PortletURL getURLEdit(
throws Exception {
PortletURL portletURL = liferayPortletResponse.createLiferayPortletURL(
- getControlPanelPlid(liferayPortletRequest), PortletKeys.WIKI,
+ getPlid(liferayPortletRequest), PortletKeys.WIKI,
PortletRequest.RENDER_PHASE);
portletURL.setParameter("struts_action", "/wiki/edit_page");
View
12 portal-service/src/com/liferay/portlet/asset/model/BaseAssetRenderer.java
@@ -179,6 +179,18 @@ protected String getIconPath(ThemeDisplay themeDisplay) {
return themeDisplay.getPathThemeImages() + "/common/page.png";
}
+ protected long getPlid(LiferayPortletRequest liferayPortletRequest)
+ throws PortalException, SystemException {
+
+ HttpServletRequest request =
+ liferayPortletRequest.getHttpServletRequest();
+
+ ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(
+ WebKeys.THEME_DISPLAY);
+
+ return themeDisplay.getPlid();
+ }
+
protected String getURLViewInContext(
LiferayPortletRequest liferayPortletRequest, String noSuchEntryRedirect,
String path, String primaryKeyParameterName,
View
4 portal-web/docroot/html/taglib/ui/input_asset_links/page.jsp
@@ -51,9 +51,7 @@ else {
}
}
-Group controlPanelGroup = GroupLocalServiceUtil.getGroup(themeDisplay.getCompanyId(), GroupConstants.CONTROL_PANEL);
-
-PortletURL assetBrowserURL = PortletURLFactoryUtil.create(request, PortletKeys.ASSET_BROWSER, LayoutLocalServiceUtil.getDefaultPlid(controlPanelGroup.getGroupId(), true), PortletRequest.RENDER_PHASE);
+PortletURL assetBrowserURL = PortletURLFactoryUtil.create(request, PortletKeys.ASSET_BROWSER, themeDisplay.getPlid(), PortletRequest.RENDER_PHASE);
assetBrowserURL.setWindowState(LiferayWindowState.POP_UP);
assetBrowserURL.setPortletMode(PortletMode.VIEW);

0 comments on commit 7eedf4c

Please sign in to comment.