001 /** 002 * Copyright (c) 2000-2012 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 /** 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 scope 050 * permissions are deleted. Be aware that this latter behavior can result in 051 * 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 name 072 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 a 087 * 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 can 145 * be performed on resources of the type. Existing actions are replaced. 146 * 147 * <p> 148 * This method can be used to set permissions at any scope, but it is 149 * generally only used at the individual scope. For example, it could be 150 * used to set the guest permissions on a blog post. 151 * </p> 152 * 153 * <p> 154 * Depending on the scope, the value of <code>primKey</code> will have 155 * different meanings. For more information, see {@link 156 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 157 * </p> 158 * 159 * @param groupId the primary key of the group 160 * @param companyId the primary key of the company 161 * @param name the resource's name, which can be either a class name or a 162 portlet ID 163 * @param primKey the primary key 164 * @param roleId the primary key of the role 165 * @param actionIds the action IDs of the actions 166 * @throws PortalException if the user did not have permission to set 167 resource permissions, or if a role with the primary key or a 168 resource action with the name and action ID could not be found 169 * @throws SystemException if a system exception occurred 170 */ 171 public void setIndividualResourcePermissions(long groupId, long companyId, 172 java.lang.String name, java.lang.String primKey, long roleId, 173 java.lang.String[] actionIds) 174 throws com.liferay.portal.kernel.exception.PortalException, 175 com.liferay.portal.kernel.exception.SystemException { 176 _resourcePermissionService.setIndividualResourcePermissions(groupId, 177 companyId, name, primKey, roleId, actionIds); 178 } 179 180 /** 181 * Updates the role's permissions at the scope, setting the actions that can 182 * be performed on resources of the type. Existing actions are replaced. 183 * 184 * <p> 185 * This method can be used to set permissions at any scope, but it is 186 * generally only used at the individual scope. For example, it could be 187 * used to set the guest permissions on a blog post. 188 * </p> 189 * 190 * <p> 191 * Depending on the scope, the value of <code>primKey</code> will have 192 * different meanings. For more information, see {@link 193 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 194 * </p> 195 * 196 * @param groupId the primary key of the group 197 * @param companyId the primary key of the company 198 * @param name the resource's name, which can be either a class name or a 199 portlet ID 200 * @param primKey the primary key 201 * @param roleIdsToActionIds a map of role IDs to action IDs of the actions 202 * @throws PortalException if the user did not have permission to set 203 resource permissions, or if a role with the primary key or a 204 resource action with the name and action ID could not be found 205 * @throws SystemException if a system exception occurred 206 */ 207 public void setIndividualResourcePermissions(long groupId, long companyId, 208 java.lang.String name, java.lang.String primKey, 209 java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds) 210 throws com.liferay.portal.kernel.exception.PortalException, 211 com.liferay.portal.kernel.exception.SystemException { 212 _resourcePermissionService.setIndividualResourcePermissions(groupId, 213 companyId, name, primKey, roleIdsToActionIds); 214 } 215 216 /** 217 * @deprecated Renamed to {@link #getWrappedService} 218 */ 219 public ResourcePermissionService getWrappedResourcePermissionService() { 220 return _resourcePermissionService; 221 } 222 223 /** 224 * @deprecated Renamed to {@link #setWrappedService} 225 */ 226 public void setWrappedResourcePermissionService( 227 ResourcePermissionService resourcePermissionService) { 228 _resourcePermissionService = resourcePermissionService; 229 } 230 231 public ResourcePermissionService getWrappedService() { 232 return _resourcePermissionService; 233 } 234 235 public void setWrappedService( 236 ResourcePermissionService resourcePermissionService) { 237 _resourcePermissionService = resourcePermissionService; 238 } 239 240 private ResourcePermissionService _resourcePermissionService; 241 }