com.liferay.notification.internal.security.permission.resource.NotificationTemplatePortletResourcePermissionWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.notification.service
Show all versions of com.liferay.notification.service
Liferay Notification Service
/**
* 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.notification.internal.security.permission.resource;
import com.liferay.notification.constants.NotificationConstants;
import com.liferay.portal.kernel.model.Group;
import com.liferay.portal.kernel.security.permission.PermissionChecker;
import com.liferay.portal.kernel.security.permission.resource.BasePortletResourcePermissionWrapper;
import com.liferay.portal.kernel.security.permission.resource.PortletResourcePermission;
import com.liferay.portal.kernel.security.permission.resource.PortletResourcePermissionFactory;
import com.liferay.portal.kernel.security.permission.resource.PortletResourcePermissionLogic;
import org.osgi.service.component.annotations.Component;
/**
* @author Gustavo Lima
* @author Murilo Stodolni
*/
@Component(
property = "resource.name=" + NotificationConstants.RESOURCE_NAME_NOTIFICATION_TEMPLATE,
service = PortletResourcePermission.class
)
public class NotificationTemplatePortletResourcePermissionWrapper
extends BasePortletResourcePermissionWrapper {
@Override
protected PortletResourcePermission doGetPortletResourcePermission() {
return PortletResourcePermissionFactory.create(
NotificationConstants.RESOURCE_NAME_NOTIFICATION_TEMPLATE,
new NotificationPortletResourcePermissionLogic());
}
private static class NotificationPortletResourcePermissionLogic
implements PortletResourcePermissionLogic {
@Override
public Boolean contains(
PermissionChecker permissionChecker, String name, Group group,
String actionId) {
if (permissionChecker.hasPermission(group, name, 0, actionId)) {
return true;
}
return false;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy