com.liferay.fragment.web.internal.security.permission.resource.FragmentPermission Maven / Gradle / Ivy
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
package com.liferay.fragment.web.internal.security.permission.resource;
import com.liferay.fragment.constants.FragmentConstants;
import com.liferay.portal.kernel.module.service.Snapshot;
import com.liferay.portal.kernel.security.permission.PermissionChecker;
import com.liferay.portal.kernel.security.permission.resource.PortletResourcePermission;
/**
* @author Preston Crary
*/
public class FragmentPermission {
public static boolean contains(
PermissionChecker permissionChecker, long groupId, String actionId) {
PortletResourcePermission portletResourcePermission =
_portletResourcePermissionSnapshot.get();
return portletResourcePermission.contains(
permissionChecker, groupId, actionId);
}
private static final Snapshot
_portletResourcePermissionSnapshot = new Snapshot<>(
FragmentPermission.class, PortletResourcePermission.class,
"(resource.name=" + FragmentConstants.RESOURCE_NAME + ")");
}