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 ResourcePermissionLocalService}. 020 * </p> 021 * 022 * @author Brian Wing Shun Chan 023 * @see ResourcePermissionLocalService 024 * @generated 025 */ 026 public class ResourcePermissionLocalServiceWrapper 027 implements ResourcePermissionLocalService, 028 ServiceWrapper<ResourcePermissionLocalService> { 029 public ResourcePermissionLocalServiceWrapper( 030 ResourcePermissionLocalService resourcePermissionLocalService) { 031 _resourcePermissionLocalService = resourcePermissionLocalService; 032 } 033 034 /** 035 * Adds the resource permission to the database. Also notifies the appropriate model listeners. 036 * 037 * @param resourcePermission the resource permission 038 * @return the resource permission that was added 039 * @throws SystemException if a system exception occurred 040 */ 041 public com.liferay.portal.model.ResourcePermission addResourcePermission( 042 com.liferay.portal.model.ResourcePermission resourcePermission) 043 throws com.liferay.portal.kernel.exception.SystemException { 044 return _resourcePermissionLocalService.addResourcePermission(resourcePermission); 045 } 046 047 /** 048 * Creates a new resource permission with the primary key. Does not add the resource permission to the database. 049 * 050 * @param resourcePermissionId the primary key for the new resource permission 051 * @return the new resource permission 052 */ 053 public com.liferay.portal.model.ResourcePermission createResourcePermission( 054 long resourcePermissionId) { 055 return _resourcePermissionLocalService.createResourcePermission(resourcePermissionId); 056 } 057 058 /** 059 * Deletes the resource permission with the primary key from the database. Also notifies the appropriate model listeners. 060 * 061 * @param resourcePermissionId the primary key of the resource permission 062 * @return the resource permission that was removed 063 * @throws PortalException if a resource permission with the primary key could not be found 064 * @throws SystemException if a system exception occurred 065 */ 066 public com.liferay.portal.model.ResourcePermission deleteResourcePermission( 067 long resourcePermissionId) 068 throws com.liferay.portal.kernel.exception.PortalException, 069 com.liferay.portal.kernel.exception.SystemException { 070 return _resourcePermissionLocalService.deleteResourcePermission(resourcePermissionId); 071 } 072 073 /** 074 * Deletes the resource permission from the database. Also notifies the appropriate model listeners. 075 * 076 * @param resourcePermission the resource permission 077 * @return the resource permission that was removed 078 * @throws SystemException if a system exception occurred 079 */ 080 public com.liferay.portal.model.ResourcePermission deleteResourcePermission( 081 com.liferay.portal.model.ResourcePermission resourcePermission) 082 throws com.liferay.portal.kernel.exception.SystemException { 083 return _resourcePermissionLocalService.deleteResourcePermission(resourcePermission); 084 } 085 086 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 087 return _resourcePermissionLocalService.dynamicQuery(); 088 } 089 090 /** 091 * Performs a dynamic query on the database and returns the matching rows. 092 * 093 * @param dynamicQuery the dynamic query 094 * @return the matching rows 095 * @throws SystemException if a system exception occurred 096 */ 097 @SuppressWarnings("rawtypes") 098 public java.util.List dynamicQuery( 099 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 100 throws com.liferay.portal.kernel.exception.SystemException { 101 return _resourcePermissionLocalService.dynamicQuery(dynamicQuery); 102 } 103 104 /** 105 * Performs a dynamic query on the database and returns a range of the matching rows. 106 * 107 * <p> 108 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 109 * </p> 110 * 111 * @param dynamicQuery the dynamic query 112 * @param start the lower bound of the range of model instances 113 * @param end the upper bound of the range of model instances (not inclusive) 114 * @return the range of matching rows 115 * @throws SystemException if a system exception occurred 116 */ 117 @SuppressWarnings("rawtypes") 118 public java.util.List dynamicQuery( 119 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 120 int end) throws com.liferay.portal.kernel.exception.SystemException { 121 return _resourcePermissionLocalService.dynamicQuery(dynamicQuery, 122 start, end); 123 } 124 125 /** 126 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 127 * 128 * <p> 129 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 130 * </p> 131 * 132 * @param dynamicQuery the dynamic query 133 * @param start the lower bound of the range of model instances 134 * @param end the upper bound of the range of model instances (not inclusive) 135 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 136 * @return the ordered range of matching rows 137 * @throws SystemException if a system exception occurred 138 */ 139 @SuppressWarnings("rawtypes") 140 public java.util.List dynamicQuery( 141 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 142 int end, 143 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 144 throws com.liferay.portal.kernel.exception.SystemException { 145 return _resourcePermissionLocalService.dynamicQuery(dynamicQuery, 146 start, end, orderByComparator); 147 } 148 149 /** 150 * Returns the number of rows that match the dynamic query. 151 * 152 * @param dynamicQuery the dynamic query 153 * @return the number of rows that match the dynamic query 154 * @throws SystemException if a system exception occurred 155 */ 156 public long dynamicQueryCount( 157 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 158 throws com.liferay.portal.kernel.exception.SystemException { 159 return _resourcePermissionLocalService.dynamicQueryCount(dynamicQuery); 160 } 161 162 public com.liferay.portal.model.ResourcePermission fetchResourcePermission( 163 long resourcePermissionId) 164 throws com.liferay.portal.kernel.exception.SystemException { 165 return _resourcePermissionLocalService.fetchResourcePermission(resourcePermissionId); 166 } 167 168 /** 169 * Returns the resource permission with the primary key. 170 * 171 * @param resourcePermissionId the primary key of the resource permission 172 * @return the resource permission 173 * @throws PortalException if a resource permission with the primary key could not be found 174 * @throws SystemException if a system exception occurred 175 */ 176 public com.liferay.portal.model.ResourcePermission getResourcePermission( 177 long resourcePermissionId) 178 throws com.liferay.portal.kernel.exception.PortalException, 179 com.liferay.portal.kernel.exception.SystemException { 180 return _resourcePermissionLocalService.getResourcePermission(resourcePermissionId); 181 } 182 183 public com.liferay.portal.model.PersistedModel getPersistedModel( 184 java.io.Serializable primaryKeyObj) 185 throws com.liferay.portal.kernel.exception.PortalException, 186 com.liferay.portal.kernel.exception.SystemException { 187 return _resourcePermissionLocalService.getPersistedModel(primaryKeyObj); 188 } 189 190 /** 191 * Returns a range of all the resource permissions. 192 * 193 * <p> 194 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 195 * </p> 196 * 197 * @param start the lower bound of the range of resource permissions 198 * @param end the upper bound of the range of resource permissions (not inclusive) 199 * @return the range of resource permissions 200 * @throws SystemException if a system exception occurred 201 */ 202 public java.util.List<com.liferay.portal.model.ResourcePermission> getResourcePermissions( 203 int start, int end) 204 throws com.liferay.portal.kernel.exception.SystemException { 205 return _resourcePermissionLocalService.getResourcePermissions(start, end); 206 } 207 208 /** 209 * Returns the number of resource permissions. 210 * 211 * @return the number of resource permissions 212 * @throws SystemException if a system exception occurred 213 */ 214 public int getResourcePermissionsCount() 215 throws com.liferay.portal.kernel.exception.SystemException { 216 return _resourcePermissionLocalService.getResourcePermissionsCount(); 217 } 218 219 /** 220 * Updates the resource permission in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 221 * 222 * @param resourcePermission the resource permission 223 * @return the resource permission that was updated 224 * @throws SystemException if a system exception occurred 225 */ 226 public com.liferay.portal.model.ResourcePermission updateResourcePermission( 227 com.liferay.portal.model.ResourcePermission resourcePermission) 228 throws com.liferay.portal.kernel.exception.SystemException { 229 return _resourcePermissionLocalService.updateResourcePermission(resourcePermission); 230 } 231 232 /** 233 * Returns the Spring bean ID for this bean. 234 * 235 * @return the Spring bean ID for this bean 236 */ 237 public java.lang.String getBeanIdentifier() { 238 return _resourcePermissionLocalService.getBeanIdentifier(); 239 } 240 241 /** 242 * Sets the Spring bean ID for this bean. 243 * 244 * @param beanIdentifier the Spring bean ID for this bean 245 */ 246 public void setBeanIdentifier(java.lang.String beanIdentifier) { 247 _resourcePermissionLocalService.setBeanIdentifier(beanIdentifier); 248 } 249 250 /** 251 * Grants the role permission at the scope to perform the action on 252 * resources of the type. Existing actions are retained. 253 * 254 * <p> 255 * This method cannot be used to grant individual scope permissions, but is 256 * only intended for adding permissions at the company, group, and 257 * group-template scopes. For example, this method could be used to grant a 258 * company scope permission to edit message board posts. 259 * </p> 260 * 261 * <p> 262 * If a company scope permission is granted to resources that the role 263 * already had group scope permissions to, the group scope permissions are 264 * deleted. Likewise, if a group scope permission is granted to resources 265 * that the role already had company scope permissions to, the company scope 266 * permissions are deleted. Be aware that this latter behavior can result in 267 * an overall reduction in permissions for the role. 268 * </p> 269 * 270 * <p> 271 * Depending on the scope, the value of <code>primKey</code> will have 272 * different meanings. For more information, see {@link 273 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 274 * </p> 275 * 276 * @param companyId the primary key of the company 277 * @param name the resource's name, which can be either a class name or a 278 portlet ID 279 * @param scope the scope. This method only supports company, group, and 280 group-template scope. 281 * @param primKey the primary key 282 * @param roleId the primary key of the role 283 * @param actionId the action ID 284 * @throws PortalException if scope was set to individual scope or if a role 285 with the primary key or a resource action with the name and 286 action ID could not be found 287 * @throws SystemException if a system exception occurred 288 */ 289 public void addResourcePermission(long companyId, java.lang.String name, 290 int scope, java.lang.String primKey, long roleId, 291 java.lang.String actionId) 292 throws com.liferay.portal.kernel.exception.PortalException, 293 com.liferay.portal.kernel.exception.SystemException { 294 _resourcePermissionLocalService.addResourcePermission(companyId, name, 295 scope, primKey, roleId, actionId); 296 } 297 298 /** 299 * Grants the role permissions at the scope to perform the actions on all 300 * resources of the type. Existing actions are retained. 301 * 302 * <p> 303 * This method should only be used to add default permissions to existing 304 * resources en masse during upgrades or while verifying permissions. For 305 * example, this method could be used to grant site members individual scope 306 * permissions to view all blog posts. 307 * </p> 308 * 309 * @param resourceName the resource's name, which can be either a class 310 name or a portlet ID 311 * @param roleName the role's name 312 * @param scope the scope 313 * @param resourceActionBitwiseValue the bitwise IDs of the actions 314 * @throws SystemException if a system exception occurred 315 */ 316 public void addResourcePermissions(java.lang.String resourceName, 317 java.lang.String roleName, int scope, long resourceActionBitwiseValue) 318 throws com.liferay.portal.kernel.exception.SystemException { 319 _resourcePermissionLocalService.addResourcePermissions(resourceName, 320 roleName, scope, resourceActionBitwiseValue); 321 } 322 323 /** 324 * Deletes all resource permissions at the scope to resources of the type. 325 * This method should not be confused with any of the 326 * <code>removeResourcePermission</code> methods, as its purpose is very 327 * different. This method should only be used for deleting resource 328 * permissions that refer to a resource when that resource is deleted. For 329 * example this method could be used to delete all individual scope 330 * permissions to a blog post when it is deleted. 331 * 332 * <p> 333 * Depending on the scope, the value of <code>primKey</code> will have 334 * different meanings. For more information, see {@link 335 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 336 * </p> 337 * 338 * @param companyId the primary key of the company 339 * @param name the resource's name, which can be either a class name or a 340 portlet ID 341 * @param scope the scope 342 * @param primKey the primary key 343 * @throws PortalException if a portal exception occurred 344 * @throws SystemException if a system exception occurred 345 */ 346 public void deleteResourcePermissions(long companyId, 347 java.lang.String name, int scope, long primKey) 348 throws com.liferay.portal.kernel.exception.PortalException, 349 com.liferay.portal.kernel.exception.SystemException { 350 _resourcePermissionLocalService.deleteResourcePermissions(companyId, 351 name, scope, primKey); 352 } 353 354 /** 355 * Deletes all resource permissions at the scope to resources of the type. 356 * This method should not be confused with any of the 357 * <code>removeResourcePermission</code> methods, as its purpose is very 358 * different. This method should only be used for deleting resource 359 * permissions that refer to a resource when that resource is deleted. For 360 * example this method could be used to delete all individual scope 361 * permissions to a blog post when it is deleted. 362 * 363 * <p> 364 * Depending on the scope, the value of <code>primKey</code> will have 365 * different meanings. For more information, see {@link 366 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 367 * </p> 368 * 369 * @param companyId the primary key of the company 370 * @param name the resource's name, which can be either a class name or a 371 portlet ID 372 * @param scope the scope 373 * @param primKey the primary key 374 * @throws PortalException if a portal exception occurred 375 * @throws SystemException if a system exception occurred 376 */ 377 public void deleteResourcePermissions(long companyId, 378 java.lang.String name, int scope, java.lang.String primKey) 379 throws com.liferay.portal.kernel.exception.PortalException, 380 com.liferay.portal.kernel.exception.SystemException { 381 _resourcePermissionLocalService.deleteResourcePermissions(companyId, 382 name, scope, primKey); 383 } 384 385 /** 386 * Returns the intersection of action IDs the role has permission at the 387 * scope to perform on resources of the type. 388 * 389 * @param companyId he primary key of the company 390 * @param name the resource's name, which can be either a class name or a 391 portlet ID 392 * @param scope the scope 393 * @param primKey the primary key 394 * @param roleId the primary key of the role 395 * @param actionIds the action IDs 396 * @return the intersection of action IDs the role has permission at the 397 scope to perform on resources of the type 398 * @throws PortalException if a resouce action could not be found for any 399 one of the actions on the resource 400 * @throws SystemException if a system exception occurred 401 */ 402 public java.util.List<java.lang.String> getAvailableResourcePermissionActionIds( 403 long companyId, java.lang.String name, int scope, 404 java.lang.String primKey, long roleId, 405 java.util.Collection<java.lang.String> actionIds) 406 throws com.liferay.portal.kernel.exception.PortalException, 407 com.liferay.portal.kernel.exception.SystemException { 408 return _resourcePermissionLocalService.getAvailableResourcePermissionActionIds(companyId, 409 name, scope, primKey, roleId, actionIds); 410 } 411 412 public java.util.Map<java.lang.Long, java.util.Set<java.lang.String>> getAvailableResourcePermissionActionIds( 413 long companyId, java.lang.String name, int scope, 414 java.lang.String primKey, long[] roleIds, 415 java.util.Collection<java.lang.String> actionIds) 416 throws com.liferay.portal.kernel.exception.PortalException, 417 com.liferay.portal.kernel.exception.SystemException { 418 return _resourcePermissionLocalService.getAvailableResourcePermissionActionIds(companyId, 419 name, scope, primKey, roleIds, actionIds); 420 } 421 422 /** 423 * Returns the resource permission for the role at the scope to perform the 424 * actions on resources of the type. 425 * 426 * @param companyId the primary key of the company 427 * @param name the resource's name, which can be either a class name or a 428 portlet ID 429 * @param scope the scope 430 * @param primKey the primary key 431 * @param roleId the primary key of the role 432 * @return the resource permission for the role at the scope to perform the 433 actions on resources of the type 434 * @throws PortalException if no matching resources could be found 435 * @throws SystemException if a system exception occurred 436 */ 437 public com.liferay.portal.model.ResourcePermission getResourcePermission( 438 long companyId, java.lang.String name, int scope, 439 java.lang.String primKey, long roleId) 440 throws com.liferay.portal.kernel.exception.PortalException, 441 com.liferay.portal.kernel.exception.SystemException { 442 return _resourcePermissionLocalService.getResourcePermission(companyId, 443 name, scope, primKey, roleId); 444 } 445 446 /** 447 * Returns all the resource permissions at the scope of the type. 448 * 449 * @param companyId the primary key of the company 450 * @param name the resource's name, which can be either a class name or a 451 portlet ID 452 * @param scope the scope 453 * @param primKey the primary key 454 * @return the resource permissions at the scope of the type 455 * @throws SystemException if a system exception occurred 456 */ 457 public java.util.List<com.liferay.portal.model.ResourcePermission> getResourcePermissions( 458 long companyId, java.lang.String name, int scope, 459 java.lang.String primKey) 460 throws com.liferay.portal.kernel.exception.SystemException { 461 return _resourcePermissionLocalService.getResourcePermissions(companyId, 462 name, scope, primKey); 463 } 464 465 /** 466 * Returns the number of resource permissions at the scope of the type. 467 * 468 * @param companyId the primary key of the company 469 * @param name the resource's name, which can be either a class name or a 470 portlet ID 471 * @param scope the scope 472 * @param primKey the primary key 473 * @return the number of resource permissions at the scope of the type 474 * @throws SystemException if a system exception occurred 475 */ 476 public int getResourcePermissionsCount(long companyId, 477 java.lang.String name, int scope, java.lang.String primKey) 478 throws com.liferay.portal.kernel.exception.SystemException { 479 return _resourcePermissionLocalService.getResourcePermissionsCount(companyId, 480 name, scope, primKey); 481 } 482 483 /** 484 * Returns the resource permissions that apply to the resource. 485 * 486 * @param companyId the primary key of the resource's company 487 * @param groupId the primary key of the resource's group 488 * @param name the resource's name, which can be either a class name or a 489 portlet ID 490 * @param primKey the primary key of the resource 491 * @return the resource permissions associated with the resource 492 * @throws SystemException if a system exception occurred 493 */ 494 public java.util.List<com.liferay.portal.model.ResourcePermission> getResourceResourcePermissions( 495 long companyId, long groupId, java.lang.String name, 496 java.lang.String primKey) 497 throws com.liferay.portal.kernel.exception.SystemException { 498 return _resourcePermissionLocalService.getResourceResourcePermissions(companyId, 499 groupId, name, primKey); 500 } 501 502 /** 503 * Returns all the resource permissions for the role. 504 * 505 * @param roleId the primary key of the role 506 * @return the resource permissions for the role 507 * @throws SystemException if a system exception occurred 508 */ 509 public java.util.List<com.liferay.portal.model.ResourcePermission> getRoleResourcePermissions( 510 long roleId) throws com.liferay.portal.kernel.exception.SystemException { 511 return _resourcePermissionLocalService.getRoleResourcePermissions(roleId); 512 } 513 514 /** 515 * Returns a range of all the resource permissions for the role at the 516 * scopes. 517 * 518 * <p> 519 * Useful when paginating results. Returns a maximum of <code>end - 520 * start</code> instances. <code>start</code> and <code>end</code> are not 521 * primary keys, they are indexes in the result set. Thus, <code>0</code> 522 * refers to the first result in the set. Setting both <code>start</code> 523 * and <code>end</code> to {@link 524 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 525 * result set. 526 * </p> 527 * 528 * @param roleId the primary key of the role 529 * @param scopes the scopes 530 * @param start the lower bound of the range of results 531 * @param end the upper bound of the range of results (not inclusive) 532 * @return the range of resource permissions for the role at the scopes 533 * @throws SystemException if a system exception occurred 534 */ 535 public java.util.List<com.liferay.portal.model.ResourcePermission> getRoleResourcePermissions( 536 long roleId, int[] scopes, int start, int end) 537 throws com.liferay.portal.kernel.exception.SystemException { 538 return _resourcePermissionLocalService.getRoleResourcePermissions(roleId, 539 scopes, start, end); 540 } 541 542 /** 543 * Returns all the resource permissions where scope = any ?. 544 * 545 * <p> 546 * Useful when paginating results. Returns a maximum of <code>end - 547 * start</code> instances. <code>start</code> and <code>end</code> are not 548 * primary keys, they are indexes in the result set. Thus, <code>0</code> 549 * refers to the first result in the set. Setting both <code>start</code> 550 * and <code>end</code> to {@link 551 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 552 * result set. 553 * </p> 554 * 555 * @param scopes the scopes 556 * @return the resource permissions where scope = any ? 557 * @throws SystemException if a system exception occurred 558 */ 559 public java.util.List<com.liferay.portal.model.ResourcePermission> getScopeResourcePermissions( 560 int[] scopes) 561 throws com.liferay.portal.kernel.exception.SystemException { 562 return _resourcePermissionLocalService.getScopeResourcePermissions(scopes); 563 } 564 565 /** 566 * Returns <code>true</code> if the resource permission grants permission to 567 * perform the resource action. Note that this method does not ensure that 568 * the resource permission refers to the same type of resource as the 569 * resource action. 570 * 571 * @param resourcePermission the resource permission 572 * @param resourceAction the resource action 573 * @return <code>true</code> if the resource permission grants permission to 574 perform the resource action 575 */ 576 public boolean hasActionId( 577 com.liferay.portal.model.ResourcePermission resourcePermission, 578 com.liferay.portal.model.ResourceAction resourceAction) { 579 return _resourcePermissionLocalService.hasActionId(resourcePermission, 580 resourceAction); 581 } 582 583 /** 584 * Returns <code>true</code> if the roles have permission at the scope to 585 * perform the action on the resources. 586 * 587 * <p> 588 * Depending on the scope, the value of <code>primKey</code> will have 589 * different meanings. For more information, see {@link 590 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 591 * </p> 592 * 593 * @param resources the resources 594 * @param roleIds the primary keys of the roles 595 * @param actionId the action ID 596 * @return <code>true</code> if any one of the roles has permission to 597 perform the action on any one of the resources; 598 <code>false</code> otherwise 599 * @throws PortalException if any one of the roles with the primary keys 600 could not be found or if a resource action with the name and 601 action ID could not be found 602 * @throws SystemException if a system exception occurred 603 */ 604 public boolean hasResourcePermission( 605 java.util.List<com.liferay.portal.model.Resource> resources, 606 long[] roleIds, java.lang.String actionId) 607 throws com.liferay.portal.kernel.exception.PortalException, 608 com.liferay.portal.kernel.exception.SystemException { 609 return _resourcePermissionLocalService.hasResourcePermission(resources, 610 roleIds, actionId); 611 } 612 613 /** 614 * Returns <code>true</code> if the role has permission at the scope to 615 * perform the action on resources of the type. 616 * 617 * <p> 618 * Depending on the scope, the value of <code>primKey</code> will have 619 * different meanings. For more information, see {@link 620 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 621 * </p> 622 * 623 * @param companyId the primary key of the company 624 * @param name the resource's name, which can be either a class name or a 625 portlet ID 626 * @param scope the scope 627 * @param primKey the primary key 628 * @param roleId the primary key of the role 629 * @param actionId the action ID 630 * @return <code>true</code> if the role has permission to perform the 631 action on the resource; <code>false</code> otherwise 632 * @throws PortalException if a role with the primary key or a resource 633 action with the name and action ID could not be found 634 * @throws SystemException if a system exception occurred 635 */ 636 public boolean hasResourcePermission(long companyId, java.lang.String name, 637 int scope, java.lang.String primKey, long roleId, 638 java.lang.String actionId) 639 throws com.liferay.portal.kernel.exception.PortalException, 640 com.liferay.portal.kernel.exception.SystemException { 641 return _resourcePermissionLocalService.hasResourcePermission(companyId, 642 name, scope, primKey, roleId, actionId); 643 } 644 645 /** 646 * Returns <code>true</code> if the roles have permission at the scope to 647 * perform the action on resources of the type. 648 * 649 * <p> 650 * Depending on the scope, the value of <code>primKey</code> will have 651 * different meanings. For more information, see {@link 652 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 653 * </p> 654 * 655 * @param companyId the primary key of the company 656 * @param name the resource's name, which can be either a class name or a 657 portlet ID 658 * @param scope the scope 659 * @param primKey the primary key 660 * @param roleIds the primary keys of the roles 661 * @param actionId the action ID 662 * @return <code>true</code> if any one of the roles has permission to 663 perform the action on the resource; <code>false</code> otherwise 664 * @throws PortalException if any one of the roles with the primary keys 665 could not be found or if a resource action with the name and 666 action ID could not be found 667 * @throws SystemException if a system exception occurred 668 */ 669 public boolean hasResourcePermission(long companyId, java.lang.String name, 670 int scope, java.lang.String primKey, long[] roleIds, 671 java.lang.String actionId) 672 throws com.liferay.portal.kernel.exception.PortalException, 673 com.liferay.portal.kernel.exception.SystemException { 674 return _resourcePermissionLocalService.hasResourcePermission(companyId, 675 name, scope, primKey, roleIds, actionId); 676 } 677 678 public boolean[] hasResourcePermissions(long companyId, 679 java.lang.String name, int scope, java.lang.String primKey, 680 long[] roleIds, java.lang.String actionId) 681 throws com.liferay.portal.kernel.exception.PortalException, 682 com.liferay.portal.kernel.exception.SystemException { 683 return _resourcePermissionLocalService.hasResourcePermissions(companyId, 684 name, scope, primKey, roleIds, actionId); 685 } 686 687 /** 688 * Returns <code>true</code> if the role has permission at the scope to 689 * perform the action on the resource. 690 * 691 * <p> 692 * Depending on the scope, the value of <code>primKey</code> will have 693 * different meanings. For more information, see {@link 694 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 695 * </p> 696 * 697 * @param companyId the primary key of the company 698 * @param name the resource's name, which can be either a class name or a 699 portlet ID 700 * @param scope the scope 701 * @param roleId the primary key of the role 702 * @param actionId the action ID 703 * @return <code>true</code> if the role has permission to perform the 704 action on the resource; <code>false</code> otherwise 705 * @throws PortalException if a role with the primary key or a resource 706 action with the name and action ID could not be found 707 * @throws SystemException if a system exception occurred 708 */ 709 public boolean hasScopeResourcePermission(long companyId, 710 java.lang.String name, int scope, long roleId, java.lang.String actionId) 711 throws com.liferay.portal.kernel.exception.PortalException, 712 com.liferay.portal.kernel.exception.SystemException { 713 return _resourcePermissionLocalService.hasScopeResourcePermission(companyId, 714 name, scope, roleId, actionId); 715 } 716 717 /** 718 * Reassigns all the resource permissions from the source role to the 719 * destination role, and deletes the source role. 720 * 721 * @param fromRoleId the primary key of the source role 722 * @param toRoleId the primary key of the destination role 723 * @throws PortalException if a role with the primary key could not be found 724 * @throws SystemException if a system exception occurred 725 */ 726 public void mergePermissions(long fromRoleId, long toRoleId) 727 throws com.liferay.portal.kernel.exception.PortalException, 728 com.liferay.portal.kernel.exception.SystemException { 729 _resourcePermissionLocalService.mergePermissions(fromRoleId, toRoleId); 730 } 731 732 /** 733 * Grants the role default permissions to all the resources of the type and 734 * at the scope stored in the resource permission, deletes the resource 735 * permission, and deletes the resource permission's role if it has no 736 * permissions remaining. 737 * 738 * @param resourcePermissionId the primary key of the resource permission 739 * @param toRoleId the primary key of the role 740 * @throws PortalException if a resource permission or role with the primary 741 key could not be found 742 * @throws SystemException if a system exception occurred 743 */ 744 public void reassignPermissions(long resourcePermissionId, long toRoleId) 745 throws com.liferay.portal.kernel.exception.PortalException, 746 com.liferay.portal.kernel.exception.SystemException { 747 _resourcePermissionLocalService.reassignPermissions(resourcePermissionId, 748 toRoleId); 749 } 750 751 /** 752 * Revokes permission at the scope from the role to perform the action on 753 * resources of the type. For example, this method could be used to revoke a 754 * group scope permission to edit blog posts. 755 * 756 * <p> 757 * Depending on the scope, the value of <code>primKey</code> will have 758 * different meanings. For more information, see {@link 759 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 760 * </p> 761 * 762 * @param companyId the primary key of the company 763 * @param name the resource's name, which can be either a class name or a 764 portlet ID 765 * @param scope the scope 766 * @param primKey the primary key 767 * @param roleId the primary key of the role 768 * @param actionId the action ID 769 * @throws PortalException if a role with the primary key or a resource 770 action with the name and action ID could not be found 771 * @throws SystemException if a system exception occurred 772 */ 773 public void removeResourcePermission(long companyId, java.lang.String name, 774 int scope, java.lang.String primKey, long roleId, 775 java.lang.String actionId) 776 throws com.liferay.portal.kernel.exception.PortalException, 777 com.liferay.portal.kernel.exception.SystemException { 778 _resourcePermissionLocalService.removeResourcePermission(companyId, 779 name, scope, primKey, roleId, actionId); 780 } 781 782 /** 783 * Revokes all permissions at the scope from the role to perform the action 784 * on resources of the type. For example, this method could be used to 785 * revoke all individual scope permissions to edit blog posts from site 786 * members. 787 * 788 * @param companyId the primary key of the company 789 * @param name the resource's name, which can be either a class name or a 790 portlet ID 791 * @param scope the scope 792 * @param roleId the primary key of the role 793 * @param actionId the action ID 794 * @throws PortalException if a role with the primary key or a resource 795 action with the name and action ID could not be found 796 * @throws SystemException if a system exception occurred 797 */ 798 public void removeResourcePermissions(long companyId, 799 java.lang.String name, int scope, long roleId, java.lang.String actionId) 800 throws com.liferay.portal.kernel.exception.PortalException, 801 com.liferay.portal.kernel.exception.SystemException { 802 _resourcePermissionLocalService.removeResourcePermissions(companyId, 803 name, scope, roleId, actionId); 804 } 805 806 /** 807 * Updates the role's permissions at the scope, setting the actions that can 808 * be performed on resources of the type, also setting the owner of any 809 * newly created resource permissions. Existing actions are replaced. 810 * 811 * <p> 812 * This method can be used to set permissions at any scope, but it is 813 * generally only used at the individual scope. For example, it could be 814 * used to set the guest permissions on a blog post. 815 * </p> 816 * 817 * <p> 818 * Depending on the scope, the value of <code>primKey</code> will have 819 * different meanings. For more information, see {@link 820 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 821 * </p> 822 * 823 * @param companyId the primary key of the company 824 * @param name the resource's name, which can be either a class name or a 825 portlet ID 826 * @param scope the scope 827 * @param primKey the primary key 828 * @param roleId the primary key of the role 829 * @param ownerId the primary key of the owner (generally the user that 830 created the resource) 831 * @param actionIds the action IDs of the actions 832 * @throws PortalException if a role with the primary key or a resource 833 action with the name and action ID could not be found 834 * @throws SystemException if a system exception occurred 835 */ 836 public void setOwnerResourcePermissions(long companyId, 837 java.lang.String name, int scope, java.lang.String primKey, 838 long roleId, long ownerId, java.lang.String[] actionIds) 839 throws com.liferay.portal.kernel.exception.PortalException, 840 com.liferay.portal.kernel.exception.SystemException { 841 _resourcePermissionLocalService.setOwnerResourcePermissions(companyId, 842 name, scope, primKey, roleId, ownerId, actionIds); 843 } 844 845 /** 846 * Updates the role's permissions at the scope, setting the actions that can 847 * be performed on resources of the type. Existing actions are replaced. 848 * 849 * <p> 850 * This method can be used to set permissions at any scope, but it is 851 * generally only used at the individual scope. For example, it could be 852 * used to set the guest permissions on a blog post. 853 * </p> 854 * 855 * <p> 856 * Depending on the scope, the value of <code>primKey</code> will have 857 * different meanings. For more information, see {@link 858 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 859 * </p> 860 * 861 * @param companyId the primary key of the company 862 * @param name the resource's name, which can be either a class name or a 863 portlet ID 864 * @param scope the scope 865 * @param primKey the primary key 866 * @param roleId the primary key of the role 867 * @param actionIds the action IDs of the actions 868 * @throws PortalException if a role with the primary key or a resource 869 action with the name and action ID could not be found 870 * @throws SystemException if a system exception occurred 871 */ 872 public void setResourcePermissions(long companyId, java.lang.String name, 873 int scope, java.lang.String primKey, long roleId, 874 java.lang.String[] actionIds) 875 throws com.liferay.portal.kernel.exception.PortalException, 876 com.liferay.portal.kernel.exception.SystemException { 877 _resourcePermissionLocalService.setResourcePermissions(companyId, name, 878 scope, primKey, roleId, actionIds); 879 } 880 881 /** 882 * Updates the role's permissions at the scope, setting the actions that can 883 * be performed on resources of the type. Existing actions are replaced. 884 * 885 * <p> 886 * This method can be used to set permissions at any scope, but it is 887 * generally only used at the individual scope. For example, it could be 888 * used to set the guest permissions on a blog post. 889 * </p> 890 * 891 * <p> 892 * Depending on the scope, the value of <code>primKey</code> will have 893 * different meanings. For more information, see {@link 894 * com.liferay.portal.model.impl.ResourcePermissionImpl}. 895 * </p> 896 * 897 * @param companyId the primary key of the company 898 * @param name the resource's name, which can be either a class name or a 899 portlet ID 900 * @param scope the scope 901 * @param primKey the primary key 902 * @param roleIdsToActionIds a map of role IDs to action IDs of the actions 903 * @throws PortalException if a role with the primary key or a resource 904 action with the name and action ID could not be found 905 * @throws SystemException if a system exception occurred 906 */ 907 public void setResourcePermissions(long companyId, java.lang.String name, 908 int scope, java.lang.String primKey, 909 java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds) 910 throws com.liferay.portal.kernel.exception.PortalException, 911 com.liferay.portal.kernel.exception.SystemException { 912 _resourcePermissionLocalService.setResourcePermissions(companyId, name, 913 scope, primKey, roleIdsToActionIds); 914 } 915 916 /** 917 * @deprecated Renamed to {@link #getWrappedService} 918 */ 919 public ResourcePermissionLocalService getWrappedResourcePermissionLocalService() { 920 return _resourcePermissionLocalService; 921 } 922 923 /** 924 * @deprecated Renamed to {@link #setWrappedService} 925 */ 926 public void setWrappedResourcePermissionLocalService( 927 ResourcePermissionLocalService resourcePermissionLocalService) { 928 _resourcePermissionLocalService = resourcePermissionLocalService; 929 } 930 931 public ResourcePermissionLocalService getWrappedService() { 932 return _resourcePermissionLocalService; 933 } 934 935 public void setWrappedService( 936 ResourcePermissionLocalService resourcePermissionLocalService) { 937 _resourcePermissionLocalService = resourcePermissionLocalService; 938 } 939 940 private ResourcePermissionLocalService _resourcePermissionLocalService; 941 }