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.wiki.service.impl.WikiNodeServiceImpl.java

License:Open Source License

@Override
public WikiNode getNode(long groupId, String name) throws PortalException {
    WikiNodePermissionChecker.check(getPermissionChecker(), groupId, name, ActionKeys.VIEW);

    return wikiNodeLocalService.getNode(groupId, name);
}

From source file:com.liferay.wiki.service.impl.WikiNodeServiceImpl.java

License:Open Source License

@Override
public List<WikiNode> getNodes(long groupId, int status) throws PortalException {

    List<WikiNode> nodes = wikiNodePersistence.filterFindByG_S(groupId, status);

    if (nodes.isEmpty()) {
        nodes = new ArrayList<>();

        List<WikiNode> allNodes = wikiNodeLocalService.getNodes(groupId, status);

        for (WikiNode node : allNodes) {
            if (WikiNodePermissionChecker.contains(getPermissionChecker(), node, ActionKeys.VIEW)) {

                nodes.add(node);//from w w w  . ja v a  2  s  . c o  m
            }
        }
    }

    return nodes;
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public WikiPage fetchPage(long nodeId, String title, double version) throws PortalException {

    WikiPage page = wikiPageLocalService.fetchPage(nodeId, title, version);

    if (page != null) {
        WikiPagePermissionChecker.check(getPermissionChecker(), page, ActionKeys.VIEW);
    }/*from   w ww.  j a va2s  .co m*/

    return page;
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public List<WikiPage> getChildren(long groupId, long nodeId, boolean head, String parentTitle)
        throws PortalException {

    WikiNodePermissionChecker.check(getPermissionChecker(), nodeId, ActionKeys.VIEW);

    return wikiPagePersistence.filterFindByG_N_H_P_S(groupId, nodeId, head, parentTitle,
            WorkflowConstants.STATUS_APPROVED);
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public WikiPage getDraftPage(long nodeId, String title) throws PortalException {

    WikiPagePermissionChecker.check(getPermissionChecker(), nodeId, title, ActionKeys.VIEW);

    return wikiPageLocalService.getDraftPage(nodeId, title);
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public List<WikiPage> getNodePages(long nodeId, int max) throws PortalException {

    List<WikiPage> pages = new ArrayList<>();

    int lastIntervalStart = 0;
    boolean listNotExhausted = true;

    while ((pages.size() < max) && listNotExhausted) {
        List<WikiPage> pageList = wikiPageLocalService.getPages(nodeId, true, lastIntervalStart,
                lastIntervalStart + max);

        lastIntervalStart += max;//  www .j  av  a2 s  . co  m
        listNotExhausted = (pageList.size() == max);

        for (WikiPage page : pageList) {
            if (pages.size() >= max) {
                break;
            }

            if (WikiPagePermissionChecker.contains(getPermissionChecker(), page, ActionKeys.VIEW)) {

                pages.add(page);
            }
        }
    }

    return pages;
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public String getNodePagesRSS(long nodeId, int max, String type, double version, String displayStyle,
        String feedURL, String entryURL, String attachmentURLPrefix) throws PortalException {

    WikiNodePermissionChecker.check(getPermissionChecker(), nodeId, ActionKeys.VIEW);

    WikiNode node = wikiNodePersistence.findByPrimaryKey(nodeId);

    List<WikiPage> pages = getNodePages(nodeId, max);

    return exportToRSS(node.getName(), node.getDescription(), type, version, displayStyle, feedURL, entryURL,
            attachmentURLPrefix, pages, false, null);
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public List<WikiPage> getOrphans(long groupId, long nodeId) throws PortalException {

    WikiNodePermissionChecker.check(getPermissionChecker(), nodeId, ActionKeys.VIEW);

    List<WikiPage> pages = wikiPagePersistence.filterFindByG_N_H_S(groupId, nodeId, true,
            WorkflowConstants.STATUS_APPROVED);

    return wikiEngineRenderer.filterOrphans(pages);
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public WikiPage getPage(long pageId) throws PortalException {
    WikiPagePermissionChecker.check(getPermissionChecker(), pageId, ActionKeys.VIEW);

    return wikiPageLocalService.getPage(pageId);
}

From source file:com.liferay.wiki.service.impl.WikiPageServiceImpl.java

License:Open Source License

@Override
public WikiPage getPage(long nodeId, String title) throws PortalException {
    WikiPagePermissionChecker.check(getPermissionChecker(), nodeId, title, ActionKeys.VIEW);

    return wikiPageLocalService.getPage(nodeId, title);
}