public interface LiferayPortletHelper
Modifier and Type | Method and Description |
---|---|
void |
checkUserPortletPermission(String actionId)
Checks to see if the current user has permission to execute the specified actionId (which, in turn, is assumed to
be an action defined for the current portlet).
|
int |
getBuildNumber()
Returns the build identifier for the running version of Liferay Portal.
|
long |
getCompanyId()
Returns the company Id associated with the community that is hosting the portlet associated with the current JSF
FacesContext.
|
String |
getDocumentLibraryURL()
Returns an absolute URL to the Liferay document library, which is the main part of different struts action paths.
|
long |
getHostGroupId()
Returns the "group Id" associated with the community that is hosting the portlet associated with the current JSF
FacesContext.
|
String |
getImageGalleryURL()
Returns an absolute URL to the Liferay image gallery, which is the main part of different struts action paths.
|
com.liferay.portal.kernel.model.Layout |
getLayout()
Returns the layout being displayed in the current context.
|
com.liferay.portal.kernel.security.permission.PermissionChecker |
getPermissionChecker()
Returns the Liferay PermissionChecker associated with the request.
|
long |
getPlid()
Returns the "Plid" (the "portal layout id"), which is the identifier of the specific "page" the portlet exists
on.
|
String |
getPortalURL()
Returns an absolute URL which is the context-path of the portal webapp.
|
com.liferay.portal.kernel.model.Portlet |
getPortlet()
Returns the
com.liferay.portal.model.Portlet object for the portlet associated with the current
request. |
String |
getPortletInstanceId()
Returns the "portlet instance Id" of the currently running portlet.
|
String |
getPortletRootId()
Returns the "portlet root Id" of the currently running portlet.
|
com.liferay.portal.kernel.model.Group |
getScopeGroup()
Returns the group (Liferay community) associated with the layout (portal page) that the portlet resides on.
|
long |
getScopeGroupId()
Returns the unique id of the group (Liferay community) associated with the layout (portal page) that the portlet
resides on.
|
com.liferay.portal.kernel.model.User |
getScopeGroupUser()
Returns the user associated with the group (Liferay community) associated with the layout (portal page) that the
portlet resides on.
|
com.liferay.portal.kernel.service.ServiceContext |
getServiceContext()
Returns an instance of a ServiceContext associated with the specified className.
|
com.liferay.portal.kernel.model.Theme |
getTheme()
Returns the theme being displayed in the current context.
|
com.liferay.portal.kernel.theme.ThemeDisplay |
getThemeDisplay()
Returns the
com.liferay.portal.kernel.theme.ThemeDisplay object, which contains a variety methods
for rendering theme specific look and feels. |
String |
getThemeImagesURL()
Returns an absolute URL which is the path to the images of the theme associated with the current Layout.
|
com.liferay.portal.kernel.model.User |
getUser()
Returns the user record of the user associated with the current JSF FacesContext.
|
long |
getUserId()
Returns the user Id of the user associated with the current JSF FacesContext
|
List<com.liferay.portal.kernel.model.Role> |
getUserRoles()
Returns a list of all of the roles played by the user associated with the current JSF FacesContext.
|
boolean |
userHasPortletPermission(String actionId)
Returns
true if the current user has permission to execute the specified actionId (which, in turn,
is assumed to be an action defined for the current portlet). |
boolean |
userHasRole(String roleName)
Returns
true if the current user has the specified role name. |
void checkUserPortletPermission(String actionId) throws AuthorizationException
AuthorizationException
- If the user does not have the portlet permission associated with the specified
actionId.userHasPortletPermission(String)
int getBuildNumber()
long getCompanyId()
String getDocumentLibraryURL()
long getHostGroupId()
String getImageGalleryURL()
com.liferay.portal.kernel.model.Layout getLayout()
com.liferay.portal.kernel.security.permission.PermissionChecker getPermissionChecker()
long getPlid()
String getPortalURL()
com.liferay.portal.kernel.model.Portlet getPortlet()
com.liferay.portal.model.Portlet
object for the portlet associated with the current
request.String getPortletInstanceId()
PortletHelper.getPortletName()
String getPortletRootId()
PortletHelper.getPortletName()
com.liferay.portal.kernel.model.Group getScopeGroup()
long getScopeGroupId()
com.liferay.portal.kernel.model.User getScopeGroupUser()
com.liferay.portal.kernel.service.ServiceContext getServiceContext()
com.liferay.portal.kernel.model.Theme getTheme()
com.liferay.portal.kernel.theme.ThemeDisplay getThemeDisplay()
com.liferay.portal.kernel.theme.ThemeDisplay
object, which contains a variety methods
for rendering theme specific look and feels.String getThemeImagesURL()
com.liferay.portal.kernel.model.User getUser()
long getUserId()
List<com.liferay.portal.kernel.model.Role> getUserRoles() throws com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.SystemException
boolean userHasPortletPermission(String actionId)
true
if the current user has permission to execute the specified actionId (which, in turn,
is assumed to be an action defined for the current portlet). Any errors that occur will be caught and re-thrown,
wrapped in a PortletRuntimeException.checkUserPortletPermission(String)
boolean userHasRole(String roleName)
true
if the current user has the specified role name.Copyright © 2019 Liferay, Inc.. All rights reserved.