Example usage for com.liferay.portal.kernel.security.permission ActionKeys VIEW

List of usage examples for com.liferay.portal.kernel.security.permission ActionKeys VIEW

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.security.permission ActionKeys VIEW.

Prototype

String VIEW

To view the source code for com.liferay.portal.kernel.security.permission ActionKeys VIEW.

Click Source Link

Usage

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Returns the web content article with the ID.
 *
 * @param  id the primary key of the web content article
 * @return the web content article with the ID
 *///from ww  w . j  a v  a 2 s  .c  om
@Override
public JournalArticle getArticle(long id) throws PortalException {
    JournalArticle article = journalArticleLocalService.getArticle(id);

    JournalArticlePermission.check(getPermissionChecker(), article, ActionKeys.VIEW);

    return article;
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Returns the latest approved web content article, or the latest unapproved
 * article if none are approved. Both approved and unapproved articles must
 * match the group and article ID./*ww  w  .j av  a  2s . c o m*/
 *
 * @param  groupId the primary key of the web content article's group
 * @param  articleId the primary key of the web content article
 * @return the matching web content article
 */
@Override
public JournalArticle getArticle(long groupId, String articleId) throws PortalException {

    JournalArticlePermission.check(getPermissionChecker(), groupId, articleId, ActionKeys.VIEW);

    return journalArticleLocalService.getArticle(groupId, articleId);
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Returns the web content article matching the group, article ID, and
 * version./* w  w w . ja v  a  2 s  .c  o  m*/
 *
 * @param  groupId the primary key of the web content article's group
 * @param  articleId the primary key of the web content article
 * @param  version the web content article's version
 * @return the matching web content article
 */
@Override
public JournalArticle getArticle(long groupId, String articleId, double version) throws PortalException {

    JournalArticlePermission.check(getPermissionChecker(), groupId, articleId, version, ActionKeys.VIEW);

    return journalArticleLocalService.getArticle(groupId, articleId, version);
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Returns the web content article matching the group, class name, and class
 * PK.//  ww  w . j av  a2 s.  c  o  m
 *
 * @param  groupId the primary key of the web content article's group
 * @param  className the DDMStructure class name if the web content article
 *         is related to a DDM structure, the primary key of the class name
 *         associated with the article, or
 *         JournalArticleConstants.CLASSNAME_ID_DEFAULT in the journal-api
 *         module otherwise
 * @param  classPK the primary key of the DDM structure, if the DDMStructure
 *         class name is given as the <code>className</code> parameter, the
 *         primary key of the class associated with the web content article,
 *         or <code>0</code> otherwise
 * @return the matching web content article
 */
@Override
public JournalArticle getArticle(long groupId, String className, long classPK) throws PortalException {

    JournalArticle article = journalArticleLocalService.getArticle(groupId, className, classPK);

    JournalArticlePermission.check(getPermissionChecker(), groupId, article.getArticleId(),
            article.getVersion(), ActionKeys.VIEW);

    return article;
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Returns the latest web content article that is approved, or the latest
 * unapproved article if none are approved. Both approved and unapproved
 * articles must match the group and URL title.
 *
 * @param  groupId the primary key of the web content article's group
 * @param  urlTitle the web content article's accessible URL title
 * @return the matching web content article
 *//* ww  w  .j av  a2s  .  co m*/
@Override
public JournalArticle getArticleByUrlTitle(long groupId, String urlTitle) throws PortalException {

    JournalArticle article = journalArticleLocalService.getArticleByUrlTitle(groupId, urlTitle);

    JournalArticlePermission.check(getPermissionChecker(), article, ActionKeys.VIEW);

    return article;
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Returns the web content from the web content article matching the group,
 * article ID, and version./*from ww  w . j  a  v  a2  s .  com*/
 *
 * @param  groupId the primary key of the web content article's group
 * @param  articleId the primary key of the web content article
 * @param  version the web content article's version
 * @param  languageId the primary key of the language translation to get
 * @param  portletRequestModel the portlet request model
 * @param  themeDisplay the theme display
 * @return the matching web content
 */
@Override
public String getArticleContent(long groupId, String articleId, double version, String languageId,
        PortletRequestModel portletRequestModel, ThemeDisplay themeDisplay) throws PortalException {

    JournalArticlePermission.check(getPermissionChecker(), groupId, articleId, version, ActionKeys.VIEW);

    return journalArticleLocalService.getArticleContent(groupId, articleId, version, null, null, languageId,
            portletRequestModel, themeDisplay);
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Returns the web content from the web content article matching the group,
 * article ID, and version./*from  w  w  w .j a  v  a  2 s. com*/
 *
 * @param      groupId the primary key of the web content article's group
 * @param      articleId the primary key of the web content article
 * @param      version the web content article's version
 * @param      languageId the primary key of the language translation to get
 * @param      themeDisplay the theme display
 * @return     the matching web content
 * @deprecated As of 4.0.0, replaced by {@link #getArticleContent(long,
 *             String, double, String, PortletRequestModel, ThemeDisplay)}
 */
@Deprecated
@Override
public String getArticleContent(long groupId, String articleId, double version, String languageId,
        ThemeDisplay themeDisplay) throws PortalException {

    JournalArticlePermission.check(getPermissionChecker(), groupId, articleId, version, ActionKeys.VIEW);

    return journalArticleLocalService.getArticleContent(groupId, articleId, version, null, languageId,
            themeDisplay);
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Returns the latest web content from the web content article matching the
 * group and article ID.//from   ww  w  .  ja  va  2  s  . c o m
 *
 * @param  groupId the primary key of the web content article's group
 * @param  articleId the primary key of the web content article
 * @param  languageId the primary key of the language translation to get
 * @param  portletRequestModel the portlet request model
 * @param  themeDisplay the theme display
 * @return the matching web content
 */
@Override
public String getArticleContent(long groupId, String articleId, String languageId,
        PortletRequestModel portletRequestModel, ThemeDisplay themeDisplay) throws PortalException {

    JournalArticlePermission.check(getPermissionChecker(), groupId, articleId, ActionKeys.VIEW);

    return journalArticleLocalService.getArticleContent(groupId, articleId, null, null, languageId,
            portletRequestModel, themeDisplay);
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Returns the latest web content from the web content article matching the
 * group and article ID./*w  w w  . ja  v  a2  s . c  o  m*/
 *
 * @param      groupId the primary key of the web content article's group
 * @param      articleId the primary key of the web content article
 * @param      languageId the primary key of the language translation to get
 * @param      themeDisplay the theme display
 * @return     the matching web content
 * @deprecated As of 4.0.0, replaced by {@link #getArticleContent(long,
 *             String, String, PortletRequestModel, ThemeDisplay)}
 */
@Deprecated
@Override
public String getArticleContent(long groupId, String articleId, String languageId, ThemeDisplay themeDisplay)
        throws PortalException {

    JournalArticlePermission.check(getPermissionChecker(), groupId, articleId, ActionKeys.VIEW);

    return journalArticleLocalService.getArticleContent(groupId, articleId, null, languageId, themeDisplay);
}

From source file:com.liferay.journal.service.impl.JournalArticleServiceImpl.java

License:Open Source License

/**
 * Returns the web content article matching the URL title that is currently
 * displayed or next to be displayed if no article is currently displayed.
 *
 * @param  groupId the primary key of the web content article's group
 * @param  urlTitle the web content article's accessible URL title
 * @return the web content article matching the URL title that is currently
 *         displayed, or next one to be displayed if no version of the
 *         article is currently displayed
 *///from   ww w .  j  av a  2s  . c o m
@Override
public JournalArticle getDisplayArticleByUrlTitle(long groupId, String urlTitle) throws PortalException {

    JournalArticle article = journalArticleLocalService.getDisplayArticleByUrlTitle(groupId, urlTitle);

    JournalArticlePermission.check(getPermissionChecker(), article, ActionKeys.VIEW);

    return article;
}