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