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