001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portal.service; 016 017 /** 018 * <p> 019 * This class is a wrapper for {@link ResourcePermissionService}. 020 * </p> 021 * 022 * @author Brian Wing Shun Chan 023 * @see ResourcePermissionService 024 * @generated 025 */ 026 public class ResourcePermissionServiceWrapper 027 implements ResourcePermissionService, 028 ServiceWrapper<ResourcePermissionService> { 029 public ResourcePermissionServiceWrapper( 030 ResourcePermissionService resourcePermissionService) { 031 _resourcePermissionService = resourcePermissionService; 032 } 033 034 /** 035 * Grants the role permission at the scope to perform the action on 036 * resources of the type. Existing actions are retained. 037 * 038 * <p> 039 * This method cannot be used to grant individual scope permissions, but is 040 * only intended for adding permissions at the company, group, and 041 * group-template scopes. For example, this method could be used to grant a 042 * company scope permission to edit message board posts. 043 * </p> 044 * 045 * <p> 046 * If a company scope permission is granted to resources that the role 047 * already had group scope permissions to, the group scope permissions are 048 * deleted. Likewise, if a group scope permission is granted to resources 049 * that the role already had company scope permissions to, the company 050 * scope permissions are deleted. Be aware that this latter behavior can 051 * result in an overall reduction in permissions for the role. 052 * </p> 053 * 054 * <p> 055 * Depending on the scope, the value of <code>primKey</code> will have 056 * different meanings. For more information, see {@link 057 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 058 * </p> 059 * 060 * @param groupId the primary key of the group 061 * @param companyId the primary key of the company 062 * @param name the resource's name, which can be either a class name or a 063 portlet ID 064 * @param scope the scope. This method only supports company, group, and 065 group-template scope. 066 * @param primKey the primary key 067 * @param roleId the primary key of the role 068 * @param actionId the action ID 069 * @throws PortalException if the user did not have permission to add 070 resource permissions, or if scope was set to individual scope or 071 if a role with the primary key or a resource action with the 072 name and action ID could not be found 073 * @throws SystemException if a system exception occurred 074 */ 075 public void addResourcePermission(long groupId, long companyId, 076 java.lang.String name, int scope, java.lang.String primKey, 077 long roleId, java.lang.String actionId) 078 throws com.liferay.portal.kernel.exception.PortalException, 079 com.liferay.portal.kernel.exception.SystemException { 080 _resourcePermissionService.addResourcePermission(groupId, companyId, 081 name, scope, primKey, roleId, actionId); 082 } 083 084 /** 085 * Revokes permission at the scope from the role to perform the action on 086 * resources of the type. For example, this method could be used to revoke 087 * a group scope permission to edit blog posts. 088 * 089 * <p> 090 * Depending on the scope, the value of <code>primKey</code> will have 091 * different meanings. For more information, see {@link 092 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 093 * </p> 094 * 095 * @param groupId the primary key of the group 096 * @param companyId the primary key of the company 097 * @param name the resource's name, which can be either a class name or a 098 portlet ID 099 * @param scope the scope 100 * @param primKey the primary key 101 * @param roleId the primary key of the role 102 * @param actionId the action ID 103 * @throws PortalException if the user did not have permission to remove 104 resource permissions, or if a role with the primary key or a 105 resource action with the name and action ID could not be found 106 * @throws SystemException if a system exception occurred 107 */ 108 public void removeResourcePermission(long groupId, long companyId, 109 java.lang.String name, int scope, java.lang.String primKey, 110 long roleId, java.lang.String actionId) 111 throws com.liferay.portal.kernel.exception.PortalException, 112 com.liferay.portal.kernel.exception.SystemException { 113 _resourcePermissionService.removeResourcePermission(groupId, companyId, 114 name, scope, primKey, roleId, actionId); 115 } 116 117 /** 118 * Revokes all permissions at the scope from the role to perform the action 119 * on resources of the type. For example, this method could be used to 120 * revoke all individual scope permissions to edit blog posts from site 121 * members. 122 * 123 * @param groupId the primary key of the group 124 * @param companyId the primary key of the company 125 * @param name the resource's name, which can be either a class name or a 126 portlet ID 127 * @param scope the scope 128 * @param roleId the primary key of the role 129 * @param actionId the action ID 130 * @throws PortalException if the user did not have permission to remove 131 resource permissions, or if a role with the primary key or a 132 resource action with the name and action ID could not be found 133 * @throws SystemException if a system exception occurred 134 */ 135 public void removeResourcePermissions(long groupId, long companyId, 136 java.lang.String name, int scope, long roleId, java.lang.String actionId) 137 throws com.liferay.portal.kernel.exception.PortalException, 138 com.liferay.portal.kernel.exception.SystemException { 139 _resourcePermissionService.removeResourcePermissions(groupId, 140 companyId, name, scope, roleId, actionId); 141 } 142 143 /** 144 * Updates the role's permissions at the scope, setting the actions that 145 * can be performed on resources of the type. Existing actions are 146 * replaced. 147 * 148 * <p> 149 * This method can be used to set permissions at any scope, but it is 150 * generally only used at the individual scope. For example, it could be 151 * used to set the guest permissions on a blog post. 152 * </p> 153 * 154 * <p> 155 * Depending on the scope, the value of <code>primKey</code> will have 156 * different meanings. For more information, see {@link 157 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 158 * </p> 159 * 160 * @param groupId the primary key of the group 161 * @param companyId the primary key of the company 162 * @param name the resource's name, which can be either a class name or a 163 portlet ID 164 * @param primKey the primary key 165 * @param roleId the primary key of the role 166 * @param actionIds the action IDs of the actions 167 * @throws PortalException if the user did not have permission to set 168 resource permissions, or if a role with the primary key or a 169 resource action with the name and action ID could not be found 170 * @throws SystemException if a system exception occurred 171 */ 172 public void setIndividualResourcePermissions(long groupId, long companyId, 173 java.lang.String name, java.lang.String primKey, long roleId, 174 java.lang.String[] actionIds) 175 throws com.liferay.portal.kernel.exception.PortalException, 176 com.liferay.portal.kernel.exception.SystemException { 177 _resourcePermissionService.setIndividualResourcePermissions(groupId, 178 companyId, name, primKey, roleId, actionIds); 179 } 180 181 /** 182 * Updates the role's permissions at the scope, setting the actions that 183 * can be performed on resources of the type. Existing actions are 184 * replaced. 185 * 186 * <p> 187 * This method can be used to set permissions at any scope, but it is 188 * generally only used at the individual scope. For example, it could be 189 * used to set the guest permissions on a blog post. 190 * </p> 191 * 192 * <p> 193 * Depending on the scope, the value of <code>primKey</code> will have 194 * different meanings. For more information, see {@link 195 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 196 * </p> 197 * 198 * @param groupId the primary key of the group 199 * @param companyId the primary key of the company 200 * @param name the resource's name, which can be either a class name or a 201 portlet ID 202 * @param primKey the primary key 203 * @param roleIdsToActionIds a map of role IDs to action IDs of the 204 actions 205 * @throws PortalException if the user did not have permission to set 206 resource permissions, or if a role with the primary key or a 207 resource action with the name and action ID could not be found 208 * @throws SystemException if a system exception occurred 209 */ 210 public void setIndividualResourcePermissions(long groupId, long companyId, 211 java.lang.String name, java.lang.String primKey, 212 java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds) 213 throws com.liferay.portal.kernel.exception.PortalException, 214 com.liferay.portal.kernel.exception.SystemException { 215 _resourcePermissionService.setIndividualResourcePermissions(groupId, 216 companyId, name, primKey, roleIdsToActionIds); 217 } 218 219 /** 220 * @deprecated Renamed to {@link #getWrappedService} 221 */ 222 public ResourcePermissionService getWrappedResourcePermissionService() { 223 return _resourcePermissionService; 224 } 225 226 /** 227 * @deprecated Renamed to {@link #setWrappedService} 228 */ 229 public void setWrappedResourcePermissionService( 230 ResourcePermissionService resourcePermissionService) { 231 _resourcePermissionService = resourcePermissionService; 232 } 233 234 public ResourcePermissionService getWrappedService() { 235 return _resourcePermissionService; 236 } 237 238 public void setWrappedService( 239 ResourcePermissionService resourcePermissionService) { 240 _resourcePermissionService = resourcePermissionService; 241 } 242 243 private ResourcePermissionService _resourcePermissionService; 244 }