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:ca.efendi.datafeeds.service.impl.CJProductServiceImpl.java

License:Open Source License

@Override
public CJProduct getCJProduct(long productId) throws PortalException {
    CJProductPermission.check(getPermissionChecker(), productId, ActionKeys.VIEW);

    return cjProductLocalService.getCJProduct(productId);
}

From source file:ca.efendi.datafeeds.service.permission.CJProductPermission.java

License:Apache License

public static boolean contains(PermissionChecker permissionChecker, CJProduct entry, String actionId) {

    String portletId = PortletProviderUtil.getPortletId(CJProduct.class.getName(), PortletProvider.Action.EDIT);

    Boolean hasPermission = StagingPermissionUtil.hasPermission(permissionChecker, entry.getGroupId(),
            CJProduct.class.getName(), entry.getProductId(), portletId, actionId);

    if (hasPermission != null) {
        return hasPermission.booleanValue();
    }//from   www. jav  a2  s  .  c om

    if (entry.isDraft() || entry.isScheduled()) {
        if (actionId.equals(ActionKeys.VIEW) && !contains(permissionChecker, entry, ActionKeys.UPDATE)) {

            return false;
        }
    } else if (entry.isPending()) {
        hasPermission = WorkflowPermissionUtil.hasPermission(permissionChecker, entry.getGroupId(),
                CJProduct.class.getName(), entry.getProductId(), actionId);

        if (hasPermission != null) {
            return hasPermission.booleanValue();
        }
    }

    if (permissionChecker.hasOwnerPermission(entry.getCompanyId(), CJProduct.class.getName(),
            entry.getProductId(), entry.getUserId(), actionId)) {

        return true;
    }

    return permissionChecker.hasPermission(entry.getGroupId(), CJProduct.class.getName(), entry.getProductId(),
            actionId);
}

From source file:ca.efendi.datafeeds.web.asset.CJProductAssetRenderer.java

License:Apache License

@Override
public boolean hasViewPermission(PermissionChecker permissionChecker) {
    return CJProductPermission.contains(permissionChecker, _entry, ActionKeys.VIEW);
}

From source file:ch.inofix.referencemanager.service.impl.BibliographyServiceImpl.java

License:Open Source License

/**
 * /*from   w w  w  . ja  v  a 2s  .c om*/
 * @param bibliographyId
 * @return
 * @since 1.0.0
 * @throws PortalException
 */
public Bibliography getBibliography(long bibliographyId) throws PortalException {

    BibliographyPermission.check(getPermissionChecker(), bibliographyId, ActionKeys.VIEW);

    return bibliographyLocalService.getBibliography(bibliographyId);
}

From source file:ch.inofix.referencemanager.service.impl.BibliographyServiceImpl.java

License:Open Source License

/**
 * /*w  w w.j  a  v a 2 s.c  om*/
 * @param uuid
 * @param groupId
 * @return
 * @since 1.0.4
 * @throws PortalException
 */
public Bibliography getBibliography(String uuid, long groupId) throws PortalException {

    Bibliography bibliography = bibliographyLocalService.getBibliographyByUuidAndGroupId(uuid, groupId);

    BibliographyPermission.check(getPermissionChecker(), bibliography, ActionKeys.VIEW);

    return bibliography;

}

From source file:ch.inofix.referencemanager.service.impl.BibliographyServiceImpl.java

License:Open Source License

/**
 * //ww  w  .j  ava  2  s  .  c o m
 * @param groupId
 * @param urlTitle
 * @return
 * @since 1.0.4
 * @throws PortalException
 */
public Bibliography getBibliography(long groupId, String urlTitle) throws PortalException {

    Bibliography bibliography = bibliographyLocalService.getBibliography(groupId, urlTitle);

    BibliographyPermission.check(getPermissionChecker(), bibliography, ActionKeys.VIEW);

    return bibliography;

}

From source file:ch.inofix.referencemanager.service.impl.ReferenceServiceImpl.java

License:Open Source License

/**
 * //from w  ww . j a  va2  s  .  c o m
 * @param referenceId
 * @return
 * @since 1.0.0
 * @throws PortalException
 */
public Reference getReference(long referenceId) throws PortalException {

    ReferencePermission.check(getPermissionChecker(), referenceId, ActionKeys.VIEW);

    return referenceLocalService.getReference(referenceId);
}

From source file:com.bemis.portal.report.service.impl.ReportDefinitionServiceImpl.java

License:Open Source License

@Override
public ReportDefinition getReportDefinition(long reportDefinitionId) throws PortalException {

    ReportDefinition reportDefinition = reportDefinitionLocalService.getReportDefinition(reportDefinitionId);

    ReportDefinitionEntryPermissionCheckerUtil.contains(getPermissionChecker(),
            reportDefinition.getReportDefinitionId(), ActionKeys.VIEW);

    return reportDefinition;
}

From source file:com.liferay.announcements.web.internal.upgrade.v1_0_2.UpgradePermission.java

License:Open Source License

protected void addAnnouncementsAdminResourceActions() {
    addResourceAction(ActionKeys.ACCESS_IN_CONTROL_PANEL, _BITWISE_VALUE_ACCESS_IN_CONTROL_PANEL);
    addResourceAction(ActionKeys.VIEW, _BITWISE_VALUE_VIEW);
}

From source file:com.liferay.asset.categories.internal.search.AssetCategoryIndexer.java

License:Open Source License

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

    AssetCategory category = _assetCategoryLocalService.getCategory(entryClassPK);

    return AssetCategoryPermission.contains(permissionChecker, category, ActionKeys.VIEW);
}