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.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.transaction.Isolation; 023 import com.liferay.portal.kernel.transaction.Transactional; 024 import com.liferay.portal.security.ac.AccessControlled; 025 026 /** 027 * Provides the remote service interface for ResourcePermission. Methods of this 028 * service are expected to have security checks based on the propagated JAAS 029 * credentials because this service can be accessed remotely. 030 * 031 * @author Brian Wing Shun Chan 032 * @see ResourcePermissionServiceUtil 033 * @see com.liferay.portal.service.base.ResourcePermissionServiceBaseImpl 034 * @see com.liferay.portal.service.impl.ResourcePermissionServiceImpl 035 * @generated 036 */ 037 @AccessControlled 038 @JSONWebService 039 @ProviderType 040 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 041 PortalException.class, SystemException.class}) 042 public interface ResourcePermissionService extends BaseService { 043 /* 044 * NOTE FOR DEVELOPERS: 045 * 046 * 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. 047 */ 048 049 /** 050 * Grants the role permission at the scope to perform the action on 051 * resources of the type. Existing actions are retained. 052 * 053 * <p> 054 * This method cannot be used to grant individual scope permissions, but is 055 * only intended for adding permissions at the company, group, and 056 * group-template scopes. For example, this method could be used to grant a 057 * company scope permission to edit message board posts. 058 * </p> 059 * 060 * <p> 061 * If a company scope permission is granted to resources that the role 062 * already had group scope permissions to, the group scope permissions are 063 * deleted. Likewise, if a group scope permission is granted to resources 064 * that the role already had company scope permissions to, the company scope 065 * permissions are deleted. Be aware that this latter behavior can result in 066 * an overall reduction in permissions for the role. 067 * </p> 068 * 069 * <p> 070 * Depending on the scope, the value of <code>primKey</code> will have 071 * different meanings. For more information, see {@link 072 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 073 * </p> 074 * 075 * @param groupId the primary key of the group 076 * @param companyId the primary key of the company 077 * @param name the resource's name, which can be either a class name or a 078 portlet ID 079 * @param scope the scope. This method only supports company, group, and 080 group-template scope. 081 * @param primKey the primary key 082 * @param roleId the primary key of the role 083 * @param actionId the action ID 084 * @throws PortalException if the user did not have permission to add 085 resource permissions, or if scope was set to individual scope or 086 if a role with the primary key or a resource action with the name 087 and action ID could not be found 088 */ 089 public void addResourcePermission(long groupId, long companyId, 090 java.lang.String name, int scope, java.lang.String primKey, 091 long roleId, java.lang.String actionId) 092 throws com.liferay.portal.kernel.exception.PortalException; 093 094 /** 095 * Returns the Spring bean ID for this bean. 096 * 097 * @return the Spring bean ID for this bean 098 */ 099 public java.lang.String getBeanIdentifier(); 100 101 /** 102 * Revokes permission at the scope from the role to perform the action on 103 * resources of the type. For example, this method could be used to revoke a 104 * group scope permission to edit blog posts. 105 * 106 * <p> 107 * Depending on the scope, the value of <code>primKey</code> will have 108 * different meanings. For more information, see {@link 109 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 110 * </p> 111 * 112 * @param groupId the primary key of the group 113 * @param companyId the primary key of the company 114 * @param name the resource's name, which can be either a class name or a 115 portlet ID 116 * @param scope the scope 117 * @param primKey the primary key 118 * @param roleId the primary key of the role 119 * @param actionId the action ID 120 * @throws PortalException if the user did not have permission to remove 121 resource permissions, or if a role with the primary key or a 122 resource action with the name and action ID could not be found 123 */ 124 public void removeResourcePermission(long groupId, long companyId, 125 java.lang.String name, int scope, java.lang.String primKey, 126 long roleId, java.lang.String actionId) 127 throws com.liferay.portal.kernel.exception.PortalException; 128 129 /** 130 * Revokes all permissions at the scope from the role to perform the action 131 * on resources of the type. For example, this method could be used to 132 * revoke all individual scope permissions to edit blog posts from site 133 * members. 134 * 135 * @param groupId the primary key of the group 136 * @param companyId the primary key of the company 137 * @param name the resource's name, which can be either a class name or a 138 portlet ID 139 * @param scope the scope 140 * @param roleId the primary key of the role 141 * @param actionId the action ID 142 * @throws PortalException if the user did not have permission to remove 143 resource permissions, or if a role with the primary key or a 144 resource action with the name and action ID could not be found 145 */ 146 public void removeResourcePermissions(long groupId, long companyId, 147 java.lang.String name, int scope, long roleId, java.lang.String actionId) 148 throws com.liferay.portal.kernel.exception.PortalException; 149 150 /** 151 * Sets the Spring bean ID for this bean. 152 * 153 * @param beanIdentifier the Spring bean ID for this bean 154 */ 155 public void setBeanIdentifier(java.lang.String beanIdentifier); 156 157 /** 158 * Updates the role's permissions at the scope, setting the actions that can 159 * be performed on resources of the type. Existing actions are replaced. 160 * 161 * <p> 162 * This method can be used to set permissions at any scope, but it is 163 * generally only used at the individual scope. For example, it could be 164 * used to set the guest permissions on a blog post. 165 * </p> 166 * 167 * <p> 168 * Depending on the scope, the value of <code>primKey</code> will have 169 * different meanings. For more information, see {@link 170 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 171 * </p> 172 * 173 * @param groupId the primary key of the group 174 * @param companyId the primary key of the company 175 * @param name the resource's name, which can be either a class name or a 176 portlet ID 177 * @param primKey the primary key 178 * @param roleId the primary key of the role 179 * @param actionIds the action IDs of the actions 180 * @throws PortalException if the user did not have permission to set 181 resource permissions, or if a role with the primary key or a 182 resource action with the name and action ID could not be found 183 */ 184 public void setIndividualResourcePermissions(long groupId, long companyId, 185 java.lang.String name, java.lang.String primKey, long roleId, 186 java.lang.String[] actionIds) 187 throws com.liferay.portal.kernel.exception.PortalException; 188 189 /** 190 * Updates the role's permissions at the scope, setting the actions that can 191 * be performed on resources of the type. Existing actions are replaced. 192 * 193 * <p> 194 * This method can be used to set permissions at any scope, but it is 195 * generally only used at the individual scope. For example, it could be 196 * used to set the guest permissions on a blog post. 197 * </p> 198 * 199 * <p> 200 * Depending on the scope, the value of <code>primKey</code> will have 201 * different meanings. For more information, see {@link 202 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 203 * </p> 204 * 205 * @param groupId the primary key of the group 206 * @param companyId the primary key of the company 207 * @param name the resource's name, which can be either a class name or a 208 portlet ID 209 * @param primKey the primary key 210 * @param roleIdsToActionIds a map of role IDs to action IDs of the actions 211 * @throws PortalException if the user did not have permission to set 212 resource permissions, or if a role with the primary key or a 213 resource action with the name and action ID could not be found 214 */ 215 public void setIndividualResourcePermissions(long groupId, long companyId, 216 java.lang.String name, java.lang.String primKey, 217 java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds) 218 throws com.liferay.portal.kernel.exception.PortalException; 219 }