Example usage for com.liferay.portal.kernel.search Indexer hasPermission

List of usage examples for com.liferay.portal.kernel.search Indexer hasPermission

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.search Indexer hasPermission.

Prototype

public boolean hasPermission(PermissionChecker permissionChecker, String entryClassName, long entryClassPK,
            String actionId) throws Exception;

Source Link

Usage

From source file:com.liferay.message.boards.internal.search.MBMessageIndexer.java

License:Open Source License

@Override
public boolean hasPermission(PermissionChecker permissionChecker, String entryClassName, long entryClassPK,
        String actionId) throws Exception {

    MBMessage message = mbMessageLocalService.getMessage(entryClassPK);

    if (message.isDiscussion()) {
        Indexer<?> indexer = IndexerRegistryUtil.getIndexer(message.getClassName());

        return indexer.hasPermission(permissionChecker, message.getClassName(), message.getClassPK(),
                ActionKeys.VIEW);//from   w ww  .j  av  a  2 s . c om
    }

    return MBMessagePermission.contains(permissionChecker, entryClassPK, ActionKeys.VIEW);
}