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