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 PermissionService}. 020 * </p> 021 * 022 * @author Brian Wing Shun Chan 023 * @see PermissionService 024 * @generated 025 */ 026 public class PermissionServiceWrapper implements PermissionService, 027 ServiceWrapper<PermissionService> { 028 public PermissionServiceWrapper(PermissionService permissionService) { 029 _permissionService = permissionService; 030 } 031 032 /** 033 * Checks to see if the group has permission to the resource. 034 * 035 * @param groupId the primary key of the group 036 * @param resourceId the primary key of the resource 037 * @throws PortalException if the group did not have permission to the 038 resource, or if a group or resource with the primary key could 039 not be found or was invalid 040 * @throws SystemException if a system exception occurred 041 */ 042 public void checkPermission(long groupId, long resourceId) 043 throws com.liferay.portal.kernel.exception.PortalException, 044 com.liferay.portal.kernel.exception.SystemException { 045 _permissionService.checkPermission(groupId, resourceId); 046 } 047 048 /** 049 * Checks to see if the group has permission to the service. 050 * 051 * @param groupId the primary key of the group 052 * @param name the service name 053 * @param primKey the primary key of the service 054 * @throws PortalException if the group did not have permission to the 055 service, if a group with the primary key could not be found or if 056 the permission information was invalid 057 * @throws SystemException if a system exception occurred 058 */ 059 public void checkPermission(long groupId, java.lang.String name, 060 long primKey) 061 throws com.liferay.portal.kernel.exception.PortalException, 062 com.liferay.portal.kernel.exception.SystemException { 063 _permissionService.checkPermission(groupId, name, primKey); 064 } 065 066 /** 067 * Checks to see if the group has permission to the service. 068 * 069 * @param groupId the primary key of the group 070 * @param name the service name 071 * @param primKey the primary key of the service 072 * @throws PortalException if the group did not have permission to the 073 service, if a group with the primary key could not be found or if 074 the permission information was invalid 075 * @throws SystemException if a system exception occurred 076 */ 077 public void checkPermission(long groupId, java.lang.String name, 078 java.lang.String primKey) 079 throws com.liferay.portal.kernel.exception.PortalException, 080 com.liferay.portal.kernel.exception.SystemException { 081 _permissionService.checkPermission(groupId, name, primKey); 082 } 083 084 /** 085 * Returns <code>true</code> if the group has permission to perform the 086 * action on the resource. 087 * 088 * @param groupId the primary key of the group 089 * @param actionId the action's ID 090 * @param resourceId the primary key of the resource 091 * @return <code>true</code> if the group has permission to perform the 092 action on the resource; <code>false</code> otherwise 093 * @throws SystemException if a system exception occurred 094 */ 095 public boolean hasGroupPermission(long groupId, java.lang.String actionId, 096 long resourceId) 097 throws com.liferay.portal.kernel.exception.SystemException { 098 return _permissionService.hasGroupPermission(groupId, actionId, 099 resourceId); 100 } 101 102 /** 103 * Returns <code>true</code> if the user has permission to perform the 104 * action on the resource. 105 * 106 * @param userId the primary key of the user 107 * @param actionId the action's ID 108 * @param resourceId the primary key of the resource 109 * @return <code>true</code> if the user has permission to perform the 110 action on the resource; <code>false</code> otherwise 111 * @throws SystemException if a system exception occurred 112 */ 113 public boolean hasUserPermission(long userId, java.lang.String actionId, 114 long resourceId) 115 throws com.liferay.portal.kernel.exception.SystemException { 116 return _permissionService.hasUserPermission(userId, actionId, resourceId); 117 } 118 119 /** 120 * Returns <code>true</code> if the user has permission to perform the 121 * action on the resources. 122 * 123 * <p> 124 * This method does not support resources managed by the resource block 125 * system. 126 * </p> 127 * 128 * @param userId the primary key of the user 129 * @param groupId the primary key of the group containing the resource 130 * @param resources representations of the resource at each scope level 131 returned by {@link 132 com.liferay.portal.security.permission.AdvancedPermissionChecker#getResources( 133 long, long, String, String, String)} 134 * @param actionId the action's ID 135 * @param permissionCheckerBag the permission checker bag 136 * @return <code>true</code> if the user has permission to perform the 137 action on the resources; <code>false</code> otherwise 138 * @throws PortalException if a resource action based on any one of the 139 resources and the action ID could not be found 140 * @throws SystemException if a system exception occurred 141 */ 142 public boolean hasUserPermissions(long userId, long groupId, 143 java.util.List<com.liferay.portal.model.Resource> resources, 144 java.lang.String actionId, 145 com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag) 146 throws com.liferay.portal.kernel.exception.PortalException, 147 com.liferay.portal.kernel.exception.SystemException { 148 return _permissionService.hasUserPermissions(userId, groupId, 149 resources, actionId, permissionCheckerBag); 150 } 151 152 /** 153 * Sets the group's permissions to perform the actions on the resource, 154 * replacing the group's existing permissions on the resource. 155 * 156 * @param groupId the primary key of the group 157 * @param actionIds the primary keys of the actions 158 * @param resourceId the primary key of the resource 159 * @throws PortalException if a group with the primary key could not be 160 found or if the group did not have permission to the resource 161 * @throws SystemException if a system exception occurred 162 */ 163 public void setGroupPermissions(long groupId, java.lang.String[] actionIds, 164 long resourceId) 165 throws com.liferay.portal.kernel.exception.PortalException, 166 com.liferay.portal.kernel.exception.SystemException { 167 _permissionService.setGroupPermissions(groupId, actionIds, resourceId); 168 } 169 170 /** 171 * Sets the entity's group permissions to perform the actions on the 172 * resource, replacing the entity's existing group permissions on the 173 * resource. Only {@link com.liferay.portal.model.Organization} and {@link 174 * com.liferay.portal.model.UserGroup} class entities are supported. 175 * 176 * @param className the class name of an organization or user group 177 * @param classPK the primary key of the class 178 * @param groupId the primary key of the group 179 * @param actionIds the primary keys of the actions 180 * @param resourceId the primary key of the resource 181 * @throws PortalException if the group did not have permission to the 182 resource, if an entity with the class name and primary key could 183 not be found, or if the entity's associated group could not be 184 found 185 * @throws SystemException if a system exception occurred 186 */ 187 public void setGroupPermissions(java.lang.String className, 188 java.lang.String classPK, long groupId, java.lang.String[] actionIds, 189 long resourceId) 190 throws com.liferay.portal.kernel.exception.PortalException, 191 com.liferay.portal.kernel.exception.SystemException { 192 _permissionService.setGroupPermissions(className, classPK, groupId, 193 actionIds, resourceId); 194 } 195 196 /** 197 * Sets the permissions of each role to perform respective actions on the 198 * resource, replacing the existing permissions of each role on the 199 * resource. 200 * 201 * @param groupId the primary key of the group 202 * @param companyId the primary key of the company 203 * @param roleIdsToActionIds the map of roles to their new actions on the 204 resource 205 * @param resourceId the primary key of the resource 206 * @throws PortalException if the group did not have permission to the 207 resource 208 * @throws SystemException if a system exception occurred 209 */ 210 public void setIndividualPermissions(long groupId, long companyId, 211 java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds, 212 long resourceId) 213 throws com.liferay.portal.kernel.exception.PortalException, 214 com.liferay.portal.kernel.exception.SystemException { 215 _permissionService.setIndividualPermissions(groupId, companyId, 216 roleIdsToActionIds, resourceId); 217 } 218 219 /** 220 * Sets the organization permission to perform the actions on the resource 221 * for a particular group, replacing the organization's existing permissions 222 * on the resource. 223 * 224 * @param organizationId the primary key of the organization 225 * @param groupId the primary key of the group in which to scope the 226 permissions 227 * @param actionIds the primary keys of the actions 228 * @param resourceId the primary key of the resource 229 * @throws PortalException if the group did not have permission to the 230 resource or if an organization with the primary key could not be 231 found 232 * @throws SystemException if a system exception occurred 233 */ 234 public void setOrgGroupPermissions(long organizationId, long groupId, 235 java.lang.String[] actionIds, long resourceId) 236 throws com.liferay.portal.kernel.exception.PortalException, 237 com.liferay.portal.kernel.exception.SystemException { 238 _permissionService.setOrgGroupPermissions(organizationId, groupId, 239 actionIds, resourceId); 240 } 241 242 /** 243 * Sets the role's permissions to perform the action on the named resource, 244 * replacing the role's existing permissions on the resource. 245 * 246 * @param roleId the primary key of the role 247 * @param groupId the primary key of the group 248 * @param name the resource name 249 * @param scope the resource scope 250 * @param primKey the resource primKey 251 * @param actionId the action's ID 252 * @throws PortalException if the group did not have permission to the role 253 or if the scope was {@link 254 com.liferay.portal.model.ResourceConstants#SCOPE_INDIVIDUAL} 255 * @throws SystemException if a system exception occurred 256 */ 257 public void setRolePermission(long roleId, long groupId, 258 java.lang.String name, int scope, java.lang.String primKey, 259 java.lang.String actionId) 260 throws com.liferay.portal.kernel.exception.PortalException, 261 com.liferay.portal.kernel.exception.SystemException { 262 _permissionService.setRolePermission(roleId, groupId, name, scope, 263 primKey, actionId); 264 } 265 266 /** 267 * Sets the role's permissions to perform the actions on the resource, 268 * replacing the role's existing permissions on the resource. 269 * 270 * @param roleId the primary key of the role 271 * @param groupId the primary key of the group 272 * @param actionIds the primary keys of the actions 273 * @param resourceId the primary key of the resource 274 * @throws PortalException if the group did not have permission to the 275 resource or if a role with the primary key could not be found 276 * @throws SystemException if a system exception occurred 277 */ 278 public void setRolePermissions(long roleId, long groupId, 279 java.lang.String[] actionIds, long resourceId) 280 throws com.liferay.portal.kernel.exception.PortalException, 281 com.liferay.portal.kernel.exception.SystemException { 282 _permissionService.setRolePermissions(roleId, groupId, actionIds, 283 resourceId); 284 } 285 286 /** 287 * Sets the user's permissions to perform the actions on the resource, 288 * replacing the user's existing permissions on the resource. 289 * 290 * @param userId the primary key of the user 291 * @param groupId the primary key of the group 292 * @param actionIds the primary keys of the actions 293 * @param resourceId the primary key of the resource 294 * @throws PortalException if the group did not have permission to the 295 resource or if a user with the primary key could not be found 296 * @throws SystemException if a system exception occurred 297 */ 298 public void setUserPermissions(long userId, long groupId, 299 java.lang.String[] actionIds, long resourceId) 300 throws com.liferay.portal.kernel.exception.PortalException, 301 com.liferay.portal.kernel.exception.SystemException { 302 _permissionService.setUserPermissions(userId, groupId, actionIds, 303 resourceId); 304 } 305 306 /** 307 * Removes the permission from the role. 308 * 309 * @param roleId the primary key of the role 310 * @param groupId the primary key of the group 311 * @param permissionId the primary key of the permission 312 * @throws PortalException if the group did not have permission to the role 313 * @throws SystemException if a system exception occurred 314 */ 315 public void unsetRolePermission(long roleId, long groupId, long permissionId) 316 throws com.liferay.portal.kernel.exception.PortalException, 317 com.liferay.portal.kernel.exception.SystemException { 318 _permissionService.unsetRolePermission(roleId, groupId, permissionId); 319 } 320 321 /** 322 * Removes the role's permissions to perform the action on the named 323 * resource with the scope and primKey. 324 * 325 * @param roleId the primary key of the role 326 * @param groupId the primary key of the group 327 * @param name the resource name 328 * @param scope the resource scope 329 * @param primKey the resource primKey 330 * @param actionId the action's ID 331 * @throws PortalException if the group did not have permission to the role 332 * @throws SystemException if a system exception occurred 333 */ 334 public void unsetRolePermission(long roleId, long groupId, 335 java.lang.String name, int scope, java.lang.String primKey, 336 java.lang.String actionId) 337 throws com.liferay.portal.kernel.exception.PortalException, 338 com.liferay.portal.kernel.exception.SystemException { 339 _permissionService.unsetRolePermission(roleId, groupId, name, scope, 340 primKey, actionId); 341 } 342 343 /** 344 * Removes the role's permissions to perform the action on the named 345 * resource. 346 * 347 * @param roleId the primary key of the role 348 * @param groupId the primary key of the group 349 * @param name the resource name 350 * @param scope the resource scope 351 * @param actionId the action's ID 352 * @throws PortalException if the group did not have permission to the role 353 * @throws SystemException if a system exception occurred 354 */ 355 public void unsetRolePermissions(long roleId, long groupId, 356 java.lang.String name, int scope, java.lang.String actionId) 357 throws com.liferay.portal.kernel.exception.PortalException, 358 com.liferay.portal.kernel.exception.SystemException { 359 _permissionService.unsetRolePermissions(roleId, groupId, name, scope, 360 actionId); 361 } 362 363 /** 364 * Removes the user's permissions to perform the actions on the resource. 365 * 366 * @param userId the primary key of the user 367 * @param groupId the primary key of the group 368 * @param actionIds the primary keys of the actions 369 * @param resourceId the primary key of the resource 370 * @throws PortalException if the group did not have permission to the 371 resource 372 * @throws SystemException if a system exception occurred 373 */ 374 public void unsetUserPermissions(long userId, long groupId, 375 java.lang.String[] actionIds, long resourceId) 376 throws com.liferay.portal.kernel.exception.PortalException, 377 com.liferay.portal.kernel.exception.SystemException { 378 _permissionService.unsetUserPermissions(userId, groupId, actionIds, 379 resourceId); 380 } 381 382 /** 383 * @deprecated Renamed to {@link #getWrappedService} 384 */ 385 public PermissionService getWrappedPermissionService() { 386 return _permissionService; 387 } 388 389 /** 390 * @deprecated Renamed to {@link #setWrappedService} 391 */ 392 public void setWrappedPermissionService(PermissionService permissionService) { 393 _permissionService = permissionService; 394 } 395 396 public PermissionService getWrappedService() { 397 return _permissionService; 398 } 399 400 public void setWrappedService(PermissionService permissionService) { 401 _permissionService = permissionService; 402 } 403 404 private PermissionService _permissionService; 405 }