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