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