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 RoleLocalService}. 021 * 022 * @author Brian Wing Shun Chan 023 * @see RoleLocalService 024 * @generated 025 */ 026 @ProviderType 027 public class RoleLocalServiceWrapper implements RoleLocalService, 028 ServiceWrapper<RoleLocalService> { 029 public RoleLocalServiceWrapper(RoleLocalService roleLocalService) { 030 _roleLocalService = roleLocalService; 031 } 032 033 @Override 034 public void addGroupRole(long groupId, com.liferay.portal.model.Role role) { 035 _roleLocalService.addGroupRole(groupId, role); 036 } 037 038 @Override 039 public void addGroupRole(long groupId, long roleId) { 040 _roleLocalService.addGroupRole(groupId, roleId); 041 } 042 043 @Override 044 public void addGroupRoles(long groupId, 045 java.util.List<com.liferay.portal.model.Role> Roles) { 046 _roleLocalService.addGroupRoles(groupId, Roles); 047 } 048 049 @Override 050 public void addGroupRoles(long groupId, long[] roleIds) { 051 _roleLocalService.addGroupRoles(groupId, roleIds); 052 } 053 054 /** 055 * Adds the role to the database. Also notifies the appropriate model listeners. 056 * 057 * @param role the role 058 * @return the role that was added 059 */ 060 @Override 061 public com.liferay.portal.model.Role addRole( 062 com.liferay.portal.model.Role role) { 063 return _roleLocalService.addRole(role); 064 } 065 066 /** 067 * Adds a role with additional parameters. The user is reindexed after role 068 * is added. 069 * 070 * @param userId the primary key of the user 071 * @param className the name of the class for which the role is created 072 (optionally <code>null</code>) 073 * @param classPK the primary key of the class for which the role is 074 created (optionally <code>0</code>) 075 * @param name the role's name 076 * @param titleMap the role's localized titles (optionally 077 <code>null</code>) 078 * @param descriptionMap the role's localized descriptions (optionally 079 <code>null</code>) 080 * @param type the role's type (optionally <code>0</code>) 081 * @param subtype the role's subtype (optionally <code>null</code>) 082 * @param serviceContext the service context to be applied (optionally 083 <code>null</code>). Can set expando bridge attributes for the 084 role. 085 * @return the role 086 */ 087 @Override 088 public com.liferay.portal.model.Role addRole(long userId, 089 java.lang.String className, long classPK, java.lang.String name, 090 java.util.Map<java.util.Locale, java.lang.String> titleMap, 091 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 092 int type, java.lang.String subtype, 093 com.liferay.portal.service.ServiceContext serviceContext) 094 throws com.liferay.portal.kernel.exception.PortalException { 095 return _roleLocalService.addRole(userId, className, classPK, name, 096 titleMap, descriptionMap, type, subtype, serviceContext); 097 } 098 099 /** 100 * Adds a role. The user is reindexed after role is added. 101 * 102 * @param userId the primary key of the user 103 * @param companyId the primary key of the company 104 * @param name the role's name 105 * @param titleMap the role's localized titles (optionally 106 <code>null</code>) 107 * @param descriptionMap the role's localized descriptions (optionally 108 <code>null</code>) 109 * @param type the role's type (optionally <code>0</code>) 110 * @return the role 111 * @deprecated As of 6.2.0, replaced by {@link #addRole(long, String, long, 112 String, Map, Map, int, String, ServiceContext)} 113 */ 114 @Deprecated 115 @Override 116 public com.liferay.portal.model.Role addRole(long userId, long companyId, 117 java.lang.String name, 118 java.util.Map<java.util.Locale, java.lang.String> titleMap, 119 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 120 int type) throws com.liferay.portal.kernel.exception.PortalException { 121 return _roleLocalService.addRole(userId, companyId, name, titleMap, 122 descriptionMap, type); 123 } 124 125 /** 126 * Adds a role with additional parameters. The user is reindexed after role 127 * is added. 128 * 129 * @param userId the primary key of the user 130 * @param companyId the primary key of the company 131 * @param name the role's name 132 * @param titleMap the role's localized titles (optionally 133 <code>null</code>) 134 * @param descriptionMap the role's localized descriptions (optionally 135 <code>null</code>) 136 * @param type the role's type (optionally <code>0</code>) 137 * @param className the name of the class for which the role is created 138 (optionally <code>null</code>) 139 * @param classPK the primary key of the class for which the role is 140 created (optionally <code>0</code>) 141 * @return the role 142 * @deprecated As of 6.2.0, replaced by {@link #addRole(long, String, long, 143 String, Map, Map, int, String, ServiceContext)} 144 */ 145 @Deprecated 146 @Override 147 public com.liferay.portal.model.Role addRole(long userId, long companyId, 148 java.lang.String name, 149 java.util.Map<java.util.Locale, java.lang.String> titleMap, 150 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 151 int type, java.lang.String className, long classPK) 152 throws com.liferay.portal.kernel.exception.PortalException { 153 return _roleLocalService.addRole(userId, companyId, name, titleMap, 154 descriptionMap, type, className, classPK); 155 } 156 157 @Override 158 public void addUserRole(long userId, com.liferay.portal.model.Role role) { 159 _roleLocalService.addUserRole(userId, role); 160 } 161 162 @Override 163 public void addUserRole(long userId, long roleId) { 164 _roleLocalService.addUserRole(userId, roleId); 165 } 166 167 /** 168 * @throws PortalException 169 */ 170 @Override 171 public void addUserRoles(long userId, 172 java.util.List<com.liferay.portal.model.Role> Roles) 173 throws com.liferay.portal.kernel.exception.PortalException { 174 _roleLocalService.addUserRoles(userId, Roles); 175 } 176 177 /** 178 * @throws PortalException 179 */ 180 @Override 181 public void addUserRoles(long userId, long[] roleIds) 182 throws com.liferay.portal.kernel.exception.PortalException { 183 _roleLocalService.addUserRoles(userId, roleIds); 184 } 185 186 /** 187 * Checks to ensure that the system roles map has appropriate default roles 188 * in each company. 189 */ 190 @Override 191 public void checkSystemRoles() 192 throws com.liferay.portal.kernel.exception.PortalException { 193 _roleLocalService.checkSystemRoles(); 194 } 195 196 /** 197 * Checks to ensure that the system roles map has appropriate default roles 198 * in the company. 199 * 200 * @param companyId the primary key of the company 201 */ 202 @Override 203 public void checkSystemRoles(long companyId) 204 throws com.liferay.portal.kernel.exception.PortalException { 205 _roleLocalService.checkSystemRoles(companyId); 206 } 207 208 @Override 209 public void clearGroupRoles(long groupId) { 210 _roleLocalService.clearGroupRoles(groupId); 211 } 212 213 @Override 214 public void clearUserRoles(long userId) { 215 _roleLocalService.clearUserRoles(userId); 216 } 217 218 /** 219 * Creates a new role with the primary key. Does not add the role to the database. 220 * 221 * @param roleId the primary key for the new role 222 * @return the new role 223 */ 224 @Override 225 public com.liferay.portal.model.Role createRole(long roleId) { 226 return _roleLocalService.createRole(roleId); 227 } 228 229 @Override 230 public void deleteGroupRole(long groupId, com.liferay.portal.model.Role role) { 231 _roleLocalService.deleteGroupRole(groupId, role); 232 } 233 234 @Override 235 public void deleteGroupRole(long groupId, long roleId) { 236 _roleLocalService.deleteGroupRole(groupId, roleId); 237 } 238 239 @Override 240 public void deleteGroupRoles(long groupId, 241 java.util.List<com.liferay.portal.model.Role> Roles) { 242 _roleLocalService.deleteGroupRoles(groupId, Roles); 243 } 244 245 @Override 246 public void deleteGroupRoles(long groupId, long[] roleIds) { 247 _roleLocalService.deleteGroupRoles(groupId, roleIds); 248 } 249 250 /** 251 * @throws PortalException 252 */ 253 @Override 254 public com.liferay.portal.model.PersistedModel deletePersistedModel( 255 com.liferay.portal.model.PersistedModel persistedModel) 256 throws com.liferay.portal.kernel.exception.PortalException { 257 return _roleLocalService.deletePersistedModel(persistedModel); 258 } 259 260 /** 261 * Deletes the role from the database. Also notifies the appropriate model listeners. 262 * 263 * @param role the role 264 * @return the role that was removed 265 * @throws PortalException 266 */ 267 @Override 268 public com.liferay.portal.model.Role deleteRole( 269 com.liferay.portal.model.Role role) 270 throws com.liferay.portal.kernel.exception.PortalException { 271 return _roleLocalService.deleteRole(role); 272 } 273 274 /** 275 * Deletes the role with the primary key from the database. Also notifies the appropriate model listeners. 276 * 277 * @param roleId the primary key of the role 278 * @return the role that was removed 279 * @throws PortalException if a role with the primary key could not be found 280 */ 281 @Override 282 public com.liferay.portal.model.Role deleteRole(long roleId) 283 throws com.liferay.portal.kernel.exception.PortalException { 284 return _roleLocalService.deleteRole(roleId); 285 } 286 287 @Override 288 public void deleteUserRole(long userId, com.liferay.portal.model.Role role) { 289 _roleLocalService.deleteUserRole(userId, role); 290 } 291 292 @Override 293 public void deleteUserRole(long userId, long roleId) { 294 _roleLocalService.deleteUserRole(userId, roleId); 295 } 296 297 @Override 298 public void deleteUserRoles(long userId, 299 java.util.List<com.liferay.portal.model.Role> Roles) { 300 _roleLocalService.deleteUserRoles(userId, Roles); 301 } 302 303 @Override 304 public void deleteUserRoles(long userId, long[] roleIds) { 305 _roleLocalService.deleteUserRoles(userId, roleIds); 306 } 307 308 @Override 309 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 310 return _roleLocalService.dynamicQuery(); 311 } 312 313 /** 314 * Performs a dynamic query on the database and returns the matching rows. 315 * 316 * @param dynamicQuery the dynamic query 317 * @return the matching rows 318 */ 319 @Override 320 public <T> java.util.List<T> dynamicQuery( 321 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 322 return _roleLocalService.dynamicQuery(dynamicQuery); 323 } 324 325 /** 326 * Performs a dynamic query on the database and returns a range of the matching rows. 327 * 328 * <p> 329 * 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.RoleModelImpl}. 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. 330 * </p> 331 * 332 * @param dynamicQuery the dynamic query 333 * @param start the lower bound of the range of model instances 334 * @param end the upper bound of the range of model instances (not inclusive) 335 * @return the range of matching rows 336 */ 337 @Override 338 public <T> java.util.List<T> dynamicQuery( 339 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 340 int end) { 341 return _roleLocalService.dynamicQuery(dynamicQuery, start, end); 342 } 343 344 /** 345 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 346 * 347 * <p> 348 * 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.RoleModelImpl}. 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. 349 * </p> 350 * 351 * @param dynamicQuery the dynamic query 352 * @param start the lower bound of the range of model instances 353 * @param end the upper bound of the range of model instances (not inclusive) 354 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 355 * @return the ordered range of matching rows 356 */ 357 @Override 358 public <T> java.util.List<T> dynamicQuery( 359 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 360 int end, 361 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 362 return _roleLocalService.dynamicQuery(dynamicQuery, start, end, 363 orderByComparator); 364 } 365 366 /** 367 * Returns the number of rows matching the dynamic query. 368 * 369 * @param dynamicQuery the dynamic query 370 * @return the number of rows matching the dynamic query 371 */ 372 @Override 373 public long dynamicQueryCount( 374 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 375 return _roleLocalService.dynamicQueryCount(dynamicQuery); 376 } 377 378 /** 379 * Returns the number of rows matching the dynamic query. 380 * 381 * @param dynamicQuery the dynamic query 382 * @param projection the projection to apply to the query 383 * @return the number of rows matching the dynamic query 384 */ 385 @Override 386 public long dynamicQueryCount( 387 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 388 com.liferay.portal.kernel.dao.orm.Projection projection) { 389 return _roleLocalService.dynamicQueryCount(dynamicQuery, projection); 390 } 391 392 /** 393 * Returns the role with the name in the company. 394 * 395 * <p> 396 * The method searches the system roles map first for default roles. If a 397 * role with the name is not found, then the method will query the database. 398 * </p> 399 * 400 * @param companyId the primary key of the company 401 * @param name the role's name 402 * @return Returns the role with the name or <code>null</code> if a role 403 with the name could not be found in the company 404 */ 405 @Override 406 public com.liferay.portal.model.Role fetchRole(long companyId, 407 java.lang.String name) { 408 return _roleLocalService.fetchRole(companyId, name); 409 } 410 411 @Override 412 public com.liferay.portal.model.Role fetchRole(long roleId) { 413 return _roleLocalService.fetchRole(roleId); 414 } 415 416 /** 417 * Returns the role with the matching UUID and company. 418 * 419 * @param uuid the role's UUID 420 * @param companyId the primary key of the company 421 * @return the matching role, or <code>null</code> if a matching role could not be found 422 */ 423 @Override 424 public com.liferay.portal.model.Role fetchRoleByUuidAndCompanyId( 425 java.lang.String uuid, long companyId) { 426 return _roleLocalService.fetchRoleByUuidAndCompanyId(uuid, companyId); 427 } 428 429 @Override 430 public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 431 return _roleLocalService.getActionableDynamicQuery(); 432 } 433 434 /** 435 * Returns the default role for the group with the primary key. 436 * 437 * <p> 438 * If the group is a site, then the default role is {@link 439 * RoleConstants#SITE_MEMBER}. If the group is an organization, then the 440 * default role is {@link RoleConstants#ORGANIZATION_USER}. If the group is 441 * a user or user group, then the default role is {@link 442 * RoleConstants#POWER_USER}. For all other group types, the default role is 443 * {@link RoleConstants#USER}. 444 * </p> 445 * 446 * @param groupId the primary key of the group 447 * @return the default role for the group with the primary key 448 */ 449 @Override 450 public com.liferay.portal.model.Role getDefaultGroupRole(long groupId) 451 throws com.liferay.portal.kernel.exception.PortalException { 452 return _roleLocalService.getDefaultGroupRole(groupId); 453 } 454 455 @Override 456 public com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery( 457 com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) { 458 return _roleLocalService.getExportActionableDynamicQuery(portletDataContext); 459 } 460 461 /** 462 * Returns the groupIds of the groups associated with the role. 463 * 464 * @param roleId the roleId of the role 465 * @return long[] the groupIds of groups associated with the role 466 */ 467 @Override 468 public long[] getGroupPrimaryKeys(long roleId) { 469 return _roleLocalService.getGroupPrimaryKeys(roleId); 470 } 471 472 @Override 473 public java.util.List<com.liferay.portal.model.Role> getGroupRelatedRoles( 474 long groupId) 475 throws com.liferay.portal.kernel.exception.PortalException { 476 return _roleLocalService.getGroupRelatedRoles(groupId); 477 } 478 479 @Override 480 public java.util.List<com.liferay.portal.model.Role> getGroupRoles( 481 long groupId) { 482 return _roleLocalService.getGroupRoles(groupId); 483 } 484 485 @Override 486 public java.util.List<com.liferay.portal.model.Role> getGroupRoles( 487 long groupId, int start, int end) { 488 return _roleLocalService.getGroupRoles(groupId, start, end); 489 } 490 491 @Override 492 public java.util.List<com.liferay.portal.model.Role> getGroupRoles( 493 long groupId, int start, int end, 494 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Role> orderByComparator) { 495 return _roleLocalService.getGroupRoles(groupId, start, end, 496 orderByComparator); 497 } 498 499 @Override 500 public int getGroupRolesCount(long groupId) { 501 return _roleLocalService.getGroupRolesCount(groupId); 502 } 503 504 @Override 505 public com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 506 return _roleLocalService.getIndexableActionableDynamicQuery(); 507 } 508 509 /** 510 * Returns the OSGi service identifier. 511 * 512 * @return the OSGi service identifier 513 */ 514 @Override 515 public java.lang.String getOSGiServiceIdentifier() { 516 return _roleLocalService.getOSGiServiceIdentifier(); 517 } 518 519 @Override 520 public com.liferay.portal.model.PersistedModel getPersistedModel( 521 java.io.Serializable primaryKeyObj) 522 throws com.liferay.portal.kernel.exception.PortalException { 523 return _roleLocalService.getPersistedModel(primaryKeyObj); 524 } 525 526 @Override 527 public java.util.List<com.liferay.portal.model.Role> getResourceBlockRoles( 528 long resourceBlockId, java.lang.String className, 529 java.lang.String actionId) { 530 return _roleLocalService.getResourceBlockRoles(resourceBlockId, 531 className, actionId); 532 } 533 534 /** 535 * Returns a map of role names to associated action IDs for the named 536 * resource in the company within the permission scope. 537 * 538 * @param companyId the primary key of the company 539 * @param name the resource name 540 * @param scope the permission scope 541 * @param primKey the primary key of the resource's class 542 * @return the role names and action IDs 543 * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P( 544 long, String, int, String) 545 */ 546 @Override 547 public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles( 548 long companyId, java.lang.String name, int scope, 549 java.lang.String primKey) { 550 return _roleLocalService.getResourceRoles(companyId, name, scope, 551 primKey); 552 } 553 554 /** 555 * Returns all the roles associated with the action ID in the company within 556 * the permission scope. 557 * 558 * @param companyId the primary key of the company 559 * @param name the resource name 560 * @param scope the permission scope 561 * @param primKey the primary key of the resource's class 562 * @param actionId the name of the resource action 563 * @return the roles 564 * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P_A( 565 long, String, int, String, String) 566 */ 567 @Override 568 public java.util.List<com.liferay.portal.model.Role> getResourceRoles( 569 long companyId, java.lang.String name, int scope, 570 java.lang.String primKey, java.lang.String actionId) { 571 return _roleLocalService.getResourceRoles(companyId, name, scope, 572 primKey, actionId); 573 } 574 575 /** 576 * Returns the role with the name in the company. 577 * 578 * <p> 579 * The method searches the system roles map first for default roles. If a 580 * role with the name is not found, then the method will query the database. 581 * </p> 582 * 583 * @param companyId the primary key of the company 584 * @param name the role's name 585 * @return the role with the name 586 */ 587 @Override 588 public com.liferay.portal.model.Role getRole(long companyId, 589 java.lang.String name) 590 throws com.liferay.portal.kernel.exception.PortalException { 591 return _roleLocalService.getRole(companyId, name); 592 } 593 594 /** 595 * Returns the role with the primary key. 596 * 597 * @param roleId the primary key of the role 598 * @return the role 599 * @throws PortalException if a role with the primary key could not be found 600 */ 601 @Override 602 public com.liferay.portal.model.Role getRole(long roleId) 603 throws com.liferay.portal.kernel.exception.PortalException { 604 return _roleLocalService.getRole(roleId); 605 } 606 607 /** 608 * Returns the role with the matching UUID and company. 609 * 610 * @param uuid the role's UUID 611 * @param companyId the primary key of the company 612 * @return the matching role 613 * @throws PortalException if a matching role could not be found 614 */ 615 @Override 616 public com.liferay.portal.model.Role getRoleByUuidAndCompanyId( 617 java.lang.String uuid, long companyId) 618 throws com.liferay.portal.kernel.exception.PortalException { 619 return _roleLocalService.getRoleByUuidAndCompanyId(uuid, companyId); 620 } 621 622 /** 623 * Returns all the roles in the company. 624 * 625 * @param companyId the primary key of the company 626 * @return the roles in the company 627 */ 628 @Override 629 public java.util.List<com.liferay.portal.model.Role> getRoles( 630 long companyId) { 631 return _roleLocalService.getRoles(companyId); 632 } 633 634 /** 635 * Returns all the roles with the types. 636 * 637 * @param companyId the primary key of the company 638 * @param types the role types (optionally <code>null</code>) 639 * @return the roles with the types 640 */ 641 @Override 642 public java.util.List<com.liferay.portal.model.Role> getRoles( 643 long companyId, int[] types) { 644 return _roleLocalService.getRoles(companyId, types); 645 } 646 647 /** 648 * Returns all the roles with the primary keys. 649 * 650 * @param roleIds the primary keys of the roles 651 * @return the roles with the primary keys 652 */ 653 @Override 654 public java.util.List<com.liferay.portal.model.Role> getRoles( 655 long[] roleIds) 656 throws com.liferay.portal.kernel.exception.PortalException { 657 return _roleLocalService.getRoles(roleIds); 658 } 659 660 /** 661 * Returns a range of all the roles. 662 * 663 * <p> 664 * 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.RoleModelImpl}. 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. 665 * </p> 666 * 667 * @param start the lower bound of the range of roles 668 * @param end the upper bound of the range of roles (not inclusive) 669 * @return the range of roles 670 */ 671 @Override 672 public java.util.List<com.liferay.portal.model.Role> getRoles(int start, 673 int end) { 674 return _roleLocalService.getRoles(start, end); 675 } 676 677 /** 678 * Returns all the roles of the type and subtype. 679 * 680 * @param type the role's type (optionally <code>0</code>) 681 * @param subtype the role's subtype (optionally <code>null</code>) 682 * @return the roles of the type and subtype 683 */ 684 @Override 685 public java.util.List<com.liferay.portal.model.Role> getRoles(int type, 686 java.lang.String subtype) { 687 return _roleLocalService.getRoles(type, subtype); 688 } 689 690 /** 691 * Returns the number of roles. 692 * 693 * @return the number of roles 694 */ 695 @Override 696 public int getRolesCount() { 697 return _roleLocalService.getRolesCount(); 698 } 699 700 /** 701 * Returns all the roles of the subtype. 702 * 703 * @param subtype the role's subtype (optionally <code>null</code>) 704 * @return the roles of the subtype 705 */ 706 @Override 707 public java.util.List<com.liferay.portal.model.Role> getSubtypeRoles( 708 java.lang.String subtype) { 709 return _roleLocalService.getSubtypeRoles(subtype); 710 } 711 712 /** 713 * Returns the number of roles of the subtype. 714 * 715 * @param subtype the role's subtype (optionally <code>null</code>) 716 * @return the number of roles of the subtype 717 */ 718 @Override 719 public int getSubtypeRolesCount(java.lang.String subtype) { 720 return _roleLocalService.getSubtypeRolesCount(subtype); 721 } 722 723 /** 724 * Returns the team role in the company. 725 * 726 * @param companyId the primary key of the company 727 * @param teamId the primary key of the team 728 * @return the team role in the company 729 */ 730 @Override 731 public com.liferay.portal.model.Role getTeamRole(long companyId, long teamId) 732 throws com.liferay.portal.kernel.exception.PortalException { 733 return _roleLocalService.getTeamRole(companyId, teamId); 734 } 735 736 /** 737 * Returns the team role map for the group. 738 * 739 * @param groupId the primary key of the group 740 * @return the team role map for the group 741 */ 742 @Override 743 public java.util.Map<com.liferay.portal.model.Team, com.liferay.portal.model.Role> getTeamRoleMap( 744 long groupId) 745 throws com.liferay.portal.kernel.exception.PortalException { 746 return _roleLocalService.getTeamRoleMap(groupId); 747 } 748 749 /** 750 * Returns the team roles in the group. 751 * 752 * @param groupId the primary key of the group 753 * @return the team roles in the group 754 */ 755 @Override 756 public java.util.List<com.liferay.portal.model.Role> getTeamRoles( 757 long groupId) 758 throws com.liferay.portal.kernel.exception.PortalException { 759 return _roleLocalService.getTeamRoles(groupId); 760 } 761 762 /** 763 * Returns the team roles in the group, excluding the specified role IDs. 764 * 765 * @param groupId the primary key of the group 766 * @param excludedRoleIds the primary keys of the roles to exclude 767 (optionally <code>null</code>) 768 * @return the team roles in the group, excluding the specified role IDs 769 */ 770 @Override 771 public java.util.List<com.liferay.portal.model.Role> getTeamRoles( 772 long groupId, long[] excludedRoleIds) 773 throws com.liferay.portal.kernel.exception.PortalException { 774 return _roleLocalService.getTeamRoles(groupId, excludedRoleIds); 775 } 776 777 /** 778 * Returns all the roles of the type. 779 * 780 * @param type the role's type (optionally <code>0</code>) 781 * @return the range of the roles of the type 782 */ 783 @Override 784 public java.util.List<com.liferay.portal.model.Role> getTypeRoles(int type) { 785 return _roleLocalService.getTypeRoles(type); 786 } 787 788 /** 789 * Returns a range of all the roles of the type. 790 * 791 * @param type the role's type (optionally <code>0</code>) 792 * @param start the lower bound of the range of roles to return 793 * @param end the upper bound of the range of roles to return (not 794 inclusive) 795 * @return the range of the roles of the type 796 */ 797 @Override 798 public java.util.List<com.liferay.portal.model.Role> getTypeRoles( 799 int type, int start, int end) { 800 return _roleLocalService.getTypeRoles(type, start, end); 801 } 802 803 /** 804 * Returns the number of roles of the type. 805 * 806 * @param type the role's type (optionally <code>0</code>) 807 * @return the number of roles of the type 808 */ 809 @Override 810 public int getTypeRolesCount(int type) { 811 return _roleLocalService.getTypeRolesCount(type); 812 } 813 814 /** 815 * Returns all the user's roles within the user group. 816 * 817 * @param userId the primary key of the user 818 * @param groupId the primary key of the group 819 * @return the user's roles within the user group 820 * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupGroupRole( 821 long, long) 822 */ 823 @Override 824 public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles( 825 long userId, long groupId) { 826 return _roleLocalService.getUserGroupGroupRoles(userId, groupId); 827 } 828 829 @Override 830 public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles( 831 long userId, long groupId, int start, int end) { 832 return _roleLocalService.getUserGroupGroupRoles(userId, groupId, start, 833 end); 834 } 835 836 @Override 837 public int getUserGroupGroupRolesCount(long userId, long groupId) { 838 return _roleLocalService.getUserGroupGroupRolesCount(userId, groupId); 839 } 840 841 /** 842 * Returns all the user's roles within the user group. 843 * 844 * @param userId the primary key of the user 845 * @param groupId the primary key of the group 846 * @return the user's roles within the user group 847 * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupRole( 848 long, long) 849 */ 850 @Override 851 public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles( 852 long userId, long groupId) { 853 return _roleLocalService.getUserGroupRoles(userId, groupId); 854 } 855 856 /** 857 * Returns the userIds of the users associated with the role. 858 * 859 * @param roleId the roleId of the role 860 * @return long[] the userIds of users associated with the role 861 */ 862 @Override 863 public long[] getUserPrimaryKeys(long roleId) { 864 return _roleLocalService.getUserPrimaryKeys(roleId); 865 } 866 867 /** 868 * Returns all the user's roles within the group. 869 * 870 * @param userId the primary key of the user 871 * @param groupId the primary key of the group 872 * @return the user's roles within the group 873 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(long, 874 long) 875 */ 876 @Override 877 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 878 long userId, long groupId) { 879 return _roleLocalService.getUserRelatedRoles(userId, groupId); 880 } 881 882 /** 883 * Returns the union of all the user's roles within the groups. 884 * 885 * @param userId the primary key of the user 886 * @param groupIds the primary keys of the groups 887 * @return the union of all the user's roles within the groups 888 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(long, 889 long[]) 890 */ 891 @Override 892 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 893 long userId, long[] groupIds) { 894 return _roleLocalService.getUserRelatedRoles(userId, groupIds); 895 } 896 897 /** 898 * Returns the union of all the user's roles within the groups. 899 * 900 * @param userId the primary key of the user 901 * @param groups the groups (optionally <code>null</code>) 902 * @return the union of all the user's roles within the groups 903 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(long, 904 List) 905 */ 906 @Override 907 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 908 long userId, java.util.List<com.liferay.portal.model.Group> groups) { 909 return _roleLocalService.getUserRelatedRoles(userId, groups); 910 } 911 912 @Override 913 public java.util.List<com.liferay.portal.model.Role> getUserRoles( 914 long userId) { 915 return _roleLocalService.getUserRoles(userId); 916 } 917 918 @Override 919 public java.util.List<com.liferay.portal.model.Role> getUserRoles( 920 long userId, int start, int end) { 921 return _roleLocalService.getUserRoles(userId, start, end); 922 } 923 924 @Override 925 public java.util.List<com.liferay.portal.model.Role> getUserRoles( 926 long userId, int start, int end, 927 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Role> orderByComparator) { 928 return _roleLocalService.getUserRoles(userId, start, end, 929 orderByComparator); 930 } 931 932 @Override 933 public int getUserRolesCount(long userId) { 934 return _roleLocalService.getUserRolesCount(userId); 935 } 936 937 @Override 938 public boolean hasGroupRole(long groupId, long roleId) { 939 return _roleLocalService.hasGroupRole(groupId, roleId); 940 } 941 942 @Override 943 public boolean hasGroupRoles(long groupId) { 944 return _roleLocalService.hasGroupRoles(groupId); 945 } 946 947 /** 948 * Returns <code>true</code> if the user is associated with the named 949 * regular role. 950 * 951 * @param userId the primary key of the user 952 * @param companyId the primary key of the company 953 * @param name the name of the role 954 * @param inherited whether to include the user's inherited roles in the 955 search 956 * @return <code>true</code> if the user is associated with the regular 957 role; <code>false</code> otherwise 958 */ 959 @Override 960 public boolean hasUserRole(long userId, long companyId, 961 java.lang.String name, boolean inherited) 962 throws com.liferay.portal.kernel.exception.PortalException { 963 return _roleLocalService.hasUserRole(userId, companyId, name, inherited); 964 } 965 966 @Override 967 public boolean hasUserRole(long userId, long roleId) { 968 return _roleLocalService.hasUserRole(userId, roleId); 969 } 970 971 @Override 972 public boolean hasUserRoles(long userId) { 973 return _roleLocalService.hasUserRoles(userId); 974 } 975 976 /** 977 * Returns <code>true</code> if the user has any one of the named regular 978 * roles. 979 * 980 * @param userId the primary key of the user 981 * @param companyId the primary key of the company 982 * @param names the names of the roles 983 * @param inherited whether to include the user's inherited roles in the 984 search 985 * @return <code>true</code> if the user has any one of the regular roles; 986 <code>false</code> otherwise 987 */ 988 @Override 989 public boolean hasUserRoles(long userId, long companyId, 990 java.lang.String[] names, boolean inherited) 991 throws com.liferay.portal.kernel.exception.PortalException { 992 return _roleLocalService.hasUserRoles(userId, companyId, names, 993 inherited); 994 } 995 996 /** 997 * Returns a role with the name in the company. 998 * 999 * @param companyId the primary key of the company 1000 * @param name the role's name (optionally <code>null</code>) 1001 * @return the role with the name, or <code>null</code> if a role with the 1002 name could not be found in the company 1003 */ 1004 @Override 1005 public com.liferay.portal.model.Role loadFetchRole(long companyId, 1006 java.lang.String name) { 1007 return _roleLocalService.loadFetchRole(companyId, name); 1008 } 1009 1010 /** 1011 * Returns a role with the name in the company. 1012 * 1013 * @param companyId the primary key of the company 1014 * @param name the role's name 1015 * @return the role with the name in the company 1016 */ 1017 @Override 1018 public com.liferay.portal.model.Role loadGetRole(long companyId, 1019 java.lang.String name) 1020 throws com.liferay.portal.kernel.exception.PortalException { 1021 return _roleLocalService.loadGetRole(companyId, name); 1022 } 1023 1024 /** 1025 * Returns an ordered range of all the roles that match the keywords, types, 1026 * and params. 1027 * 1028 * <p> 1029 * Useful when paginating results. Returns a maximum of <code>end - 1030 * start</code> instances. <code>start</code> and <code>end</code> are not 1031 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1032 * refers to the first result in the set. Setting both <code>start</code> 1033 * and <code>end</code> to {@link 1034 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1035 * result set. 1036 * </p> 1037 * 1038 * @param companyId the primary key of the company 1039 * @param keywords the keywords (space separated), which may occur in the 1040 role's name or description (optionally <code>null</code>) 1041 * @param types the role types (optionally <code>null</code>) 1042 * @param params the finder parameters. Can specify values for the 1043 "usersRoles" key. For more information, see {@link 1044 com.liferay.portal.service.persistence.RoleFinder} 1045 * @param start the lower bound of the range of roles to return 1046 * @param end the upper bound of the range of roles to return (not 1047 inclusive) 1048 * @param obc the comparator to order the roles (optionally 1049 <code>null</code>) 1050 * @return the ordered range of the matching roles, ordered by 1051 <code>obc</code> 1052 * @see com.liferay.portal.service.persistence.RoleFinder 1053 */ 1054 @Override 1055 public java.util.List<com.liferay.portal.model.Role> search( 1056 long companyId, java.lang.String keywords, java.lang.Integer[] types, 1057 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1058 int start, int end, 1059 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Role> obc) { 1060 return _roleLocalService.search(companyId, keywords, types, params, 1061 start, end, obc); 1062 } 1063 1064 /** 1065 * Returns an ordered range of all the roles that match the keywords and 1066 * types. 1067 * 1068 * <p> 1069 * Useful when paginating results. Returns a maximum of <code>end - 1070 * start</code> instances. <code>start</code> and <code>end</code> are not 1071 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1072 * refers to the first result in the set. Setting both <code>start</code> 1073 * and <code>end</code> to {@link 1074 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1075 * result set. 1076 * </p> 1077 * 1078 * @param companyId the primary key of the company 1079 * @param keywords the keywords (space separated), which may occur in the 1080 role's name or description (optionally <code>null</code>) 1081 * @param types the role types (optionally <code>null</code>) 1082 * @param start the lower bound of the range of roles to return 1083 * @param end the upper bound of the range of roles to return (not 1084 inclusive) 1085 * @param obc the comparator to order the roles (optionally 1086 <code>null</code>) 1087 * @return the ordered range of the matching roles, ordered by 1088 <code>obc</code> 1089 * @see com.liferay.portal.service.persistence.RoleFinder 1090 */ 1091 @Override 1092 public java.util.List<com.liferay.portal.model.Role> search( 1093 long companyId, java.lang.String keywords, java.lang.Integer[] types, 1094 int start, int end, 1095 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Role> obc) { 1096 return _roleLocalService.search(companyId, keywords, types, start, end, 1097 obc); 1098 } 1099 1100 /** 1101 * Returns an ordered range of all the roles that match the name, 1102 * description, types, and params. 1103 * 1104 * <p> 1105 * Useful when paginating results. Returns a maximum of <code>end - 1106 * start</code> instances. <code>start</code> and <code>end</code> are not 1107 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1108 * refers to the first result in the set. Setting both <code>start</code> 1109 * and <code>end</code> to {@link 1110 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1111 * result set. 1112 * </p> 1113 * 1114 * @param companyId the primary key of the company 1115 * @param name the role's name (optionally <code>null</code>) 1116 * @param description the role's description (optionally <code>null</code>) 1117 * @param types the role types (optionally <code>null</code>) 1118 * @param params the finder's parameters. Can specify values for the 1119 "usersRoles" key. For more information, see {@link 1120 com.liferay.portal.service.persistence.RoleFinder} 1121 * @param start the lower bound of the range of the roles to return 1122 * @param end the upper bound of the range of the roles to return (not 1123 inclusive) 1124 * @param obc the comparator to order the roles (optionally 1125 <code>null</code>) 1126 * @return the ordered range of the matching roles, ordered by 1127 <code>obc</code> 1128 * @see com.liferay.portal.service.persistence.RoleFinder 1129 */ 1130 @Override 1131 public java.util.List<com.liferay.portal.model.Role> search( 1132 long companyId, java.lang.String name, java.lang.String description, 1133 java.lang.Integer[] types, 1134 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1135 int start, int end, 1136 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Role> obc) { 1137 return _roleLocalService.search(companyId, name, description, types, 1138 params, start, end, obc); 1139 } 1140 1141 /** 1142 * Returns an ordered range of all the roles that match the name, 1143 * description, and types. 1144 * 1145 * <p> 1146 * Useful when paginating results. Returns a maximum of <code>end - 1147 * start</code> instances. <code>start</code> and <code>end</code> are not 1148 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1149 * refers to the first result in the set. Setting both <code>start</code> 1150 * and <code>end</code> to {@link 1151 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1152 * result set. 1153 * </p> 1154 * 1155 * @param companyId the primary key of the company 1156 * @param name the role's name (optionally <code>null</code>) 1157 * @param description the role's description (optionally <code>null</code>) 1158 * @param types the role types (optionally <code>null</code>) 1159 * @param start the lower bound of the range of the roles to return 1160 * @param end the upper bound of the range of the roles to return (not 1161 inclusive) 1162 * @param obc the comparator to order the roles (optionally 1163 <code>null</code>) 1164 * @return the ordered range of the matching roles, ordered by 1165 <code>obc</code> 1166 * @see com.liferay.portal.service.persistence.RoleFinder 1167 */ 1168 @Override 1169 public java.util.List<com.liferay.portal.model.Role> search( 1170 long companyId, java.lang.String name, java.lang.String description, 1171 java.lang.Integer[] types, int start, int end, 1172 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Role> obc) { 1173 return _roleLocalService.search(companyId, name, description, types, 1174 start, end, obc); 1175 } 1176 1177 /** 1178 * Returns the number of roles that match the keywords and types. 1179 * 1180 * @param companyId the primary key of the company 1181 * @param keywords the keywords (space separated), which may occur in the 1182 role's name or description (optionally <code>null</code>) 1183 * @param types the role types (optionally <code>null</code>) 1184 * @return the number of matching roles 1185 */ 1186 @Override 1187 public int searchCount(long companyId, java.lang.String keywords, 1188 java.lang.Integer[] types) { 1189 return _roleLocalService.searchCount(companyId, keywords, types); 1190 } 1191 1192 /** 1193 * Returns the number of roles that match the keywords, types and params. 1194 * 1195 * @param companyId the primary key of the company 1196 * @param keywords the keywords (space separated), which may occur in the 1197 role's name or description (optionally <code>null</code>) 1198 * @param types the role types (optionally <code>null</code>) 1199 * @param params the finder parameters. For more information, see {@link 1200 com.liferay.portal.service.persistence.RoleFinder} 1201 * @return the number of matching roles 1202 */ 1203 @Override 1204 public int searchCount(long companyId, java.lang.String keywords, 1205 java.lang.Integer[] types, 1206 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) { 1207 return _roleLocalService.searchCount(companyId, keywords, types, params); 1208 } 1209 1210 /** 1211 * Returns the number of roles that match the name, description, and types. 1212 * 1213 * @param companyId the primary key of the company 1214 * @param name the role's name (optionally <code>null</code>) 1215 * @param description the role's description (optionally <code>null</code>) 1216 * @param types the role types (optionally <code>null</code>) 1217 * @return the number of matching roles 1218 */ 1219 @Override 1220 public int searchCount(long companyId, java.lang.String name, 1221 java.lang.String description, java.lang.Integer[] types) { 1222 return _roleLocalService.searchCount(companyId, name, description, types); 1223 } 1224 1225 /** 1226 * Returns the number of roles that match the name, description, types, and 1227 * params. 1228 * 1229 * @param companyId the primary key of the company 1230 * @param name the role's name (optionally <code>null</code>) 1231 * @param description the role's description (optionally <code>null</code>) 1232 * @param types the role types (optionally <code>null</code>) 1233 * @param params the finder parameters. Can specify values for the 1234 "usersRoles" key. For more information, see {@link 1235 com.liferay.portal.service.persistence.RoleFinder} 1236 * @return the number of matching roles 1237 */ 1238 @Override 1239 public int searchCount(long companyId, java.lang.String name, 1240 java.lang.String description, java.lang.Integer[] types, 1241 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) { 1242 return _roleLocalService.searchCount(companyId, name, description, 1243 types, params); 1244 } 1245 1246 @Override 1247 public void setGroupRoles(long groupId, long[] roleIds) { 1248 _roleLocalService.setGroupRoles(groupId, roleIds); 1249 } 1250 1251 /** 1252 * @throws PortalException 1253 */ 1254 @Override 1255 public void setUserRoles(long userId, long[] roleIds) 1256 throws com.liferay.portal.kernel.exception.PortalException { 1257 _roleLocalService.setUserRoles(userId, roleIds); 1258 } 1259 1260 /** 1261 * Removes the matching roles associated with the user. The user is 1262 * reindexed after the roles are removed. 1263 * 1264 * @param userId the primary key of the user 1265 * @param roleIds the primary keys of the roles 1266 */ 1267 @Override 1268 public void unsetUserRoles(long userId, long[] roleIds) 1269 throws com.liferay.portal.kernel.exception.PortalException { 1270 _roleLocalService.unsetUserRoles(userId, roleIds); 1271 } 1272 1273 /** 1274 * Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 1275 * 1276 * @param role the role 1277 * @return the role that was updated 1278 */ 1279 @Override 1280 public com.liferay.portal.model.Role updateRole( 1281 com.liferay.portal.model.Role role) { 1282 return _roleLocalService.updateRole(role); 1283 } 1284 1285 /** 1286 * Updates the role with the primary key. 1287 * 1288 * @param roleId the primary key of the role 1289 * @param name the role's new name 1290 * @param titleMap the new localized titles (optionally <code>null</code>) 1291 to replace those existing for the role 1292 * @param descriptionMap the new localized descriptions (optionally 1293 <code>null</code>) to replace those existing for the role 1294 * @param subtype the role's new subtype (optionally <code>null</code>) 1295 * @param serviceContext the service context to be applied (optionally 1296 <code>null</code>). Can set expando bridge attributes for the 1297 role. 1298 * @return the role with the primary key 1299 */ 1300 @Override 1301 public com.liferay.portal.model.Role updateRole(long roleId, 1302 java.lang.String name, 1303 java.util.Map<java.util.Locale, java.lang.String> titleMap, 1304 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 1305 java.lang.String subtype, 1306 com.liferay.portal.service.ServiceContext serviceContext) 1307 throws com.liferay.portal.kernel.exception.PortalException { 1308 return _roleLocalService.updateRole(roleId, name, titleMap, 1309 descriptionMap, subtype, serviceContext); 1310 } 1311 1312 @Override 1313 public RoleLocalService getWrappedService() { 1314 return _roleLocalService; 1315 } 1316 1317 @Override 1318 public void setWrappedService(RoleLocalService roleLocalService) { 1319 _roleLocalService = roleLocalService; 1320 } 1321 1322 private RoleLocalService _roleLocalService; 1323 }