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