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