001 /** 002 * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.kernel.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.exception.PortalException; 020 import com.liferay.portal.kernel.exception.SystemException; 021 import com.liferay.portal.kernel.jsonwebservice.JSONWebService; 022 import com.liferay.portal.kernel.security.access.control.AccessControlled; 023 import com.liferay.portal.kernel.transaction.Isolation; 024 import com.liferay.portal.kernel.transaction.Transactional; 025 026 import java.util.Map; 027 028 /** 029 * Provides the remote service interface for ResourcePermission. Methods of this 030 * service are expected to have security checks based on the propagated JAAS 031 * credentials because this service can be accessed remotely. 032 * 033 * @author Brian Wing Shun Chan 034 * @see ResourcePermissionServiceUtil 035 * @see com.liferay.portal.service.base.ResourcePermissionServiceBaseImpl 036 * @see com.liferay.portal.service.impl.ResourcePermissionServiceImpl 037 * @generated 038 */ 039 @AccessControlled 040 @JSONWebService 041 @ProviderType 042 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 043 PortalException.class, SystemException.class}) 044 public interface ResourcePermissionService extends BaseService { 045 /* 046 * NOTE FOR DEVELOPERS: 047 * 048 * Never modify or reference this interface directly. Always use {@link ResourcePermissionServiceUtil} to access the resource permission remote service. Add custom service methods to {@link com.liferay.portal.service.impl.ResourcePermissionServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 049 */ 050 051 /** 052 * Grants the role permission at the scope to perform the action on 053 * resources of the type. Existing actions are retained. 054 * 055 * <p> 056 * This method cannot be used to grant individual scope permissions, but is 057 * only intended for adding permissions at the company, group, and 058 * group-template scopes. For example, this method could be used to grant a 059 * company scope permission to edit message board posts. 060 * </p> 061 * 062 * <p> 063 * If a company scope permission is granted to resources that the role 064 * already had group scope permissions to, the group scope permissions are 065 * deleted. Likewise, if a group scope permission is granted to resources 066 * that the role already had company scope permissions to, the company scope 067 * permissions are deleted. Be aware that this latter behavior can result in 068 * an overall reduction in permissions for the role. 069 * </p> 070 * 071 * <p> 072 * Depending on the scope, the value of <code>primKey</code> will have 073 * different meanings. For more information, see {@link 074 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 075 * </p> 076 * 077 * @param groupId the primary key of the group 078 * @param companyId the primary key of the company 079 * @param name the resource's name, which can be either a class name or a 080 portlet ID 081 * @param scope the scope. This method only supports company, group, and 082 group-template scope. 083 * @param primKey the primary key 084 * @param roleId the primary key of the role 085 * @param actionId the action ID 086 */ 087 public void addResourcePermission(long groupId, long companyId, 088 java.lang.String name, int scope, java.lang.String primKey, 089 long roleId, java.lang.String actionId) throws PortalException; 090 091 /** 092 * Returns the OSGi service identifier. 093 * 094 * @return the OSGi service identifier 095 */ 096 public java.lang.String getOSGiServiceIdentifier(); 097 098 /** 099 * Revokes permission at the scope from the role to perform the action on 100 * resources of the type. For example, this method could be used to revoke a 101 * group scope permission to edit blog posts. 102 * 103 * <p> 104 * Depending on the scope, the value of <code>primKey</code> will have 105 * different meanings. For more information, see {@link 106 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 107 * </p> 108 * 109 * @param groupId the primary key of the group 110 * @param companyId the primary key of the company 111 * @param name the resource's name, which can be either a class name or a 112 portlet ID 113 * @param scope the scope 114 * @param primKey the primary key 115 * @param roleId the primary key of the role 116 * @param actionId the action ID 117 */ 118 public void removeResourcePermission(long groupId, long companyId, 119 java.lang.String name, int scope, java.lang.String primKey, 120 long roleId, java.lang.String actionId) throws PortalException; 121 122 /** 123 * Revokes all permissions at the scope from the role to perform the action 124 * on resources of the type. For example, this method could be used to 125 * revoke all individual scope permissions to edit blog posts from site 126 * members. 127 * 128 * @param groupId the primary key of the group 129 * @param companyId the primary key of the company 130 * @param name the resource's name, which can be either a class name or a 131 portlet ID 132 * @param scope the scope 133 * @param roleId the primary key of the role 134 * @param actionId the action ID 135 */ 136 public void removeResourcePermissions(long groupId, long companyId, 137 java.lang.String name, int scope, long roleId, java.lang.String actionId) 138 throws PortalException; 139 140 /** 141 * Updates the role's permissions at the scope, setting the actions that can 142 * be performed on resources of the type. Existing actions are replaced. 143 * 144 * <p> 145 * This method can be used to set permissions at any scope, but it is 146 * generally only used at the individual scope. For example, it could be 147 * used to set the guest permissions on a blog post. 148 * </p> 149 * 150 * <p> 151 * Depending on the scope, the value of <code>primKey</code> will have 152 * different meanings. For more information, see {@link 153 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 154 * </p> 155 * 156 * @param groupId the primary key of the group 157 * @param companyId the primary key of the company 158 * @param name the resource's name, which can be either a class name or a 159 portlet ID 160 * @param primKey the primary key 161 * @param roleId the primary key of the role 162 * @param actionIds the action IDs of the actions 163 */ 164 public void setIndividualResourcePermissions(long groupId, long companyId, 165 java.lang.String name, java.lang.String primKey, long roleId, 166 java.lang.String[] actionIds) throws PortalException; 167 168 /** 169 * Updates the role's permissions at the scope, setting the actions that can 170 * be performed on resources of the type. Existing actions are replaced. 171 * 172 * <p> 173 * This method can be used to set permissions at any scope, but it is 174 * generally only used at the individual scope. For example, it could be 175 * used to set the guest permissions on a blog post. 176 * </p> 177 * 178 * <p> 179 * Depending on the scope, the value of <code>primKey</code> will have 180 * different meanings. For more information, see {@link 181 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 182 * </p> 183 * 184 * @param groupId the primary key of the group 185 * @param companyId the primary key of the company 186 * @param name the resource's name, which can be either a class name or a 187 portlet ID 188 * @param primKey the primary key 189 * @param roleIdsToActionIds a map of role IDs to action IDs of the actions 190 */ 191 public void setIndividualResourcePermissions(long groupId, long companyId, 192 java.lang.String name, java.lang.String primKey, 193 Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds) 194 throws PortalException; 195 }