001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service; 016 017 /** 018 * <p> 019 * This class is a wrapper for {@link RoleLocalService}. 020 * </p> 021 * 022 * @author Brian Wing Shun Chan 023 * @see RoleLocalService 024 * @generated 025 */ 026 public class RoleLocalServiceWrapper implements RoleLocalService { 027 public RoleLocalServiceWrapper(RoleLocalService roleLocalService) { 028 _roleLocalService = roleLocalService; 029 } 030 031 /** 032 * Adds the role to the database. Also notifies the appropriate model listeners. 033 * 034 * @param role the role 035 * @return the role that was added 036 * @throws SystemException if a system exception occurred 037 */ 038 public com.liferay.portal.model.Role addRole( 039 com.liferay.portal.model.Role role) 040 throws com.liferay.portal.kernel.exception.SystemException { 041 return _roleLocalService.addRole(role); 042 } 043 044 /** 045 * Creates a new role with the primary key. Does not add the role to the database. 046 * 047 * @param roleId the primary key for the new role 048 * @return the new role 049 */ 050 public com.liferay.portal.model.Role createRole(long roleId) { 051 return _roleLocalService.createRole(roleId); 052 } 053 054 /** 055 * Deletes the role with the primary key from the database. Also notifies the appropriate model listeners. 056 * 057 * @param roleId the primary key of the role 058 * @throws PortalException if a role with the primary key could not be found 059 * @throws SystemException if a system exception occurred 060 */ 061 public void deleteRole(long roleId) 062 throws com.liferay.portal.kernel.exception.PortalException, 063 com.liferay.portal.kernel.exception.SystemException { 064 _roleLocalService.deleteRole(roleId); 065 } 066 067 /** 068 * Deletes the role from the database. Also notifies the appropriate model listeners. 069 * 070 * @param role the role 071 * @throws PortalException 072 * @throws SystemException if a system exception occurred 073 */ 074 public void deleteRole(com.liferay.portal.model.Role role) 075 throws com.liferay.portal.kernel.exception.PortalException, 076 com.liferay.portal.kernel.exception.SystemException { 077 _roleLocalService.deleteRole(role); 078 } 079 080 /** 081 * Performs a dynamic query on the database and returns the matching rows. 082 * 083 * @param dynamicQuery the dynamic query 084 * @return the matching rows 085 * @throws SystemException if a system exception occurred 086 */ 087 @SuppressWarnings("rawtypes") 088 public java.util.List dynamicQuery( 089 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 090 throws com.liferay.portal.kernel.exception.SystemException { 091 return _roleLocalService.dynamicQuery(dynamicQuery); 092 } 093 094 /** 095 * Performs a dynamic query on the database and returns a range of the matching rows. 096 * 097 * <p> 098 * 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. 099 * </p> 100 * 101 * @param dynamicQuery the dynamic query 102 * @param start the lower bound of the range of model instances 103 * @param end the upper bound of the range of model instances (not inclusive) 104 * @return the range of matching rows 105 * @throws SystemException if a system exception occurred 106 */ 107 @SuppressWarnings("rawtypes") 108 public java.util.List dynamicQuery( 109 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 110 int end) throws com.liferay.portal.kernel.exception.SystemException { 111 return _roleLocalService.dynamicQuery(dynamicQuery, start, end); 112 } 113 114 /** 115 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 116 * 117 * <p> 118 * 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. 119 * </p> 120 * 121 * @param dynamicQuery the dynamic query 122 * @param start the lower bound of the range of model instances 123 * @param end the upper bound of the range of model instances (not inclusive) 124 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 125 * @return the ordered range of matching rows 126 * @throws SystemException if a system exception occurred 127 */ 128 @SuppressWarnings("rawtypes") 129 public java.util.List dynamicQuery( 130 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 131 int end, 132 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 133 throws com.liferay.portal.kernel.exception.SystemException { 134 return _roleLocalService.dynamicQuery(dynamicQuery, start, end, 135 orderByComparator); 136 } 137 138 /** 139 * Returns the number of rows that match the dynamic query. 140 * 141 * @param dynamicQuery the dynamic query 142 * @return the number of rows that match the dynamic query 143 * @throws SystemException if a system exception occurred 144 */ 145 public long dynamicQueryCount( 146 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 147 throws com.liferay.portal.kernel.exception.SystemException { 148 return _roleLocalService.dynamicQueryCount(dynamicQuery); 149 } 150 151 /** 152 * Returns the role with the primary key. 153 * 154 * @param roleId the primary key of the role 155 * @return the role 156 * @throws PortalException if a role with the primary key could not be found 157 * @throws SystemException if a system exception occurred 158 */ 159 public com.liferay.portal.model.Role getRole(long roleId) 160 throws com.liferay.portal.kernel.exception.PortalException, 161 com.liferay.portal.kernel.exception.SystemException { 162 return _roleLocalService.getRole(roleId); 163 } 164 165 public com.liferay.portal.model.PersistedModel getPersistedModel( 166 java.io.Serializable primaryKeyObj) 167 throws com.liferay.portal.kernel.exception.PortalException, 168 com.liferay.portal.kernel.exception.SystemException { 169 return _roleLocalService.getPersistedModel(primaryKeyObj); 170 } 171 172 /** 173 * Returns a range of all the roles. 174 * 175 * <p> 176 * 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. 177 * </p> 178 * 179 * @param start the lower bound of the range of roles 180 * @param end the upper bound of the range of roles (not inclusive) 181 * @return the range of roles 182 * @throws SystemException if a system exception occurred 183 */ 184 public java.util.List<com.liferay.portal.model.Role> getRoles(int start, 185 int end) throws com.liferay.portal.kernel.exception.SystemException { 186 return _roleLocalService.getRoles(start, end); 187 } 188 189 /** 190 * Returns the number of roles. 191 * 192 * @return the number of roles 193 * @throws SystemException if a system exception occurred 194 */ 195 public int getRolesCount() 196 throws com.liferay.portal.kernel.exception.SystemException { 197 return _roleLocalService.getRolesCount(); 198 } 199 200 /** 201 * Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 202 * 203 * @param role the role 204 * @return the role that was updated 205 * @throws SystemException if a system exception occurred 206 */ 207 public com.liferay.portal.model.Role updateRole( 208 com.liferay.portal.model.Role role) 209 throws com.liferay.portal.kernel.exception.SystemException { 210 return _roleLocalService.updateRole(role); 211 } 212 213 /** 214 * Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 215 * 216 * @param role the role 217 * @param merge whether to merge the role with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation. 218 * @return the role that was updated 219 * @throws SystemException if a system exception occurred 220 */ 221 public com.liferay.portal.model.Role updateRole( 222 com.liferay.portal.model.Role role, boolean merge) 223 throws com.liferay.portal.kernel.exception.SystemException { 224 return _roleLocalService.updateRole(role, merge); 225 } 226 227 /** 228 * Returns the Spring bean ID for this bean. 229 * 230 * @return the Spring bean ID for this bean 231 */ 232 public java.lang.String getBeanIdentifier() { 233 return _roleLocalService.getBeanIdentifier(); 234 } 235 236 /** 237 * Sets the Spring bean ID for this bean. 238 * 239 * @param beanIdentifier the Spring bean ID for this bean 240 */ 241 public void setBeanIdentifier(java.lang.String beanIdentifier) { 242 _roleLocalService.setBeanIdentifier(beanIdentifier); 243 } 244 245 /** 246 * Adds a role. The user is reindexed after role is added. 247 * 248 * @param userId the primary key of the user 249 * @param companyId the primary key of the company 250 * @param name the role's name 251 * @param titleMap the role's localized titles (optionally 252 <code>null</code>) 253 * @param descriptionMap the role's localized descriptions (optionally 254 <code>null</code>) 255 * @param type the role's type (optionally <code>0</code>) 256 * @return the role 257 * @throws PortalException if the class name or the role name 258 were invalid, if the role is a duplicate, or if a user with the primary key could not be 259 found 260 * @throws SystemException if a system exception occurred 261 */ 262 public com.liferay.portal.model.Role addRole(long userId, long companyId, 263 java.lang.String name, 264 java.util.Map<java.util.Locale, java.lang.String> titleMap, 265 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 266 int type) 267 throws com.liferay.portal.kernel.exception.PortalException, 268 com.liferay.portal.kernel.exception.SystemException { 269 return _roleLocalService.addRole(userId, companyId, name, titleMap, 270 descriptionMap, type); 271 } 272 273 /** 274 * Adds a role with additional parameters. The user is reindexed after role 275 * is added. 276 * 277 * @param userId the primary key of the user 278 * @param companyId the primary key of the company 279 * @param name the role's name 280 * @param titleMap the role's localized titles (optionally 281 <code>null</code>) 282 * @param descriptionMap the role's localized descriptions (optionally 283 <code>null</code>) 284 * @param type the role's type (optionally <code>0</code>) 285 * @param className the name of the class for which the role is created 286 (optionally <code>null</code>) 287 * @param classPK the primary key of the class for which the role is 288 created (optionally <code>0</code>) 289 * @return the role 290 * @throws PortalException if the class name or the role name 291 were invalid, if the role is a duplicate, or if a user with the primary key could not be 292 found 293 * @throws SystemException if a system exception occurred 294 */ 295 public com.liferay.portal.model.Role addRole(long userId, long companyId, 296 java.lang.String name, 297 java.util.Map<java.util.Locale, java.lang.String> titleMap, 298 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 299 int type, java.lang.String className, long classPK) 300 throws com.liferay.portal.kernel.exception.PortalException, 301 com.liferay.portal.kernel.exception.SystemException { 302 return _roleLocalService.addRole(userId, companyId, name, titleMap, 303 descriptionMap, type, className, classPK); 304 } 305 306 /** 307 * Adds the roles to the user. The user is reindexed after the roles are 308 * added. 309 * 310 * @param userId the primary key of the user 311 * @param roleIds the primary keys of the roles 312 * @throws PortalException if a user with the primary key could not be 313 found 314 * @throws SystemException if a system exception occurred 315 * @see com.liferay.portal.service.persistence.UserPersistence#addRoles( 316 long, long[]) 317 */ 318 public void addUserRoles(long userId, long[] roleIds) 319 throws com.liferay.portal.kernel.exception.PortalException, 320 com.liferay.portal.kernel.exception.SystemException { 321 _roleLocalService.addUserRoles(userId, roleIds); 322 } 323 324 /** 325 * Checks to ensure that the system roles map has appropriate default roles 326 * in each company. 327 * 328 * @throws PortalException if the current user did not have permission to 329 set applicable permissions on a role 330 * @throws SystemException if a system exception occurred 331 */ 332 public void checkSystemRoles() 333 throws com.liferay.portal.kernel.exception.PortalException, 334 com.liferay.portal.kernel.exception.SystemException { 335 _roleLocalService.checkSystemRoles(); 336 } 337 338 /** 339 * Checks to ensure that the system roles map has appropriate default roles 340 * in the company. 341 * 342 * @param companyId the primary key of the company 343 * @throws PortalException if the current user did not have permission to 344 set applicable permissions on a role 345 * @throws SystemException if a system exception occurred 346 */ 347 public void checkSystemRoles(long companyId) 348 throws com.liferay.portal.kernel.exception.PortalException, 349 com.liferay.portal.kernel.exception.SystemException { 350 _roleLocalService.checkSystemRoles(companyId); 351 } 352 353 /** 354 * Returns the role with the name in the company. 355 * 356 * <p> 357 * The method searches the system roles map first for default roles. If a 358 * role with the name is not found, then the method will query the 359 * database. 360 * </p> 361 * 362 * @param companyId the primary key of the company 363 * @param name the role's name 364 * @return Returns the role with the name or <code>null</code> if a role 365 with the name could not be found in the company 366 * @throws SystemException if a system exception occurred 367 */ 368 public com.liferay.portal.model.Role fetchRole(long companyId, 369 java.lang.String name) 370 throws com.liferay.portal.kernel.exception.SystemException { 371 return _roleLocalService.fetchRole(companyId, name); 372 } 373 374 /** 375 * Returns the default role for the group with the primary key. 376 * 377 * <p> 378 * If the group is a site, then the default role is {@link 379 * com.liferay.portal.model.RoleConstants#SITE_MEMBER}. If the group is an 380 * organization, then the default role is {@link 381 * com.liferay.portal.model.RoleConstants#ORGANIZATION_USER}. If the group 382 * is a user or user group, then the default role is {@link 383 * com.liferay.portal.model.RoleConstants#POWER_USER}. For all other group 384 * types, the default role is {@link 385 * com.liferay.portal.model.RoleConstants#USER}. 386 * </p> 387 * 388 * @param groupId the primary key of the group 389 * @return the default role for the group with the primary key 390 * @throws PortalException if a group with the primary key could not be 391 found, or if a default role could not be found for the group 392 * @throws SystemException if a system exception occurred 393 */ 394 public com.liferay.portal.model.Role getDefaultGroupRole(long groupId) 395 throws com.liferay.portal.kernel.exception.PortalException, 396 com.liferay.portal.kernel.exception.SystemException { 397 return _roleLocalService.getDefaultGroupRole(groupId); 398 } 399 400 /** 401 * Returns all the roles associated with the group. 402 * 403 * @param groupId the primary key of the group 404 * @return the roles associated with the group 405 * @throws SystemException if a system exception occurred 406 */ 407 public java.util.List<com.liferay.portal.model.Role> getGroupRoles( 408 long groupId) 409 throws com.liferay.portal.kernel.exception.SystemException { 410 return _roleLocalService.getGroupRoles(groupId); 411 } 412 413 /** 414 * Returns a map of role names to associated action IDs for the named 415 * resource in the company within the permission scope. 416 * 417 * @param companyId the primary key of the company 418 * @param name the resource name 419 * @param scope the permission scope 420 * @param primKey the primary key of the resource's class 421 * @return the role names and action IDs 422 * @throws SystemException if a system exception occurred 423 * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P( 424 long, String, int, String) 425 */ 426 public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles( 427 long companyId, java.lang.String name, int scope, 428 java.lang.String primKey) 429 throws com.liferay.portal.kernel.exception.SystemException { 430 return _roleLocalService.getResourceRoles(companyId, name, scope, 431 primKey); 432 } 433 434 /** 435 * Returns all the roles associated with the action ID in the company 436 * within the permission scope. 437 * 438 * @param companyId the primary key of the company 439 * @param name the resource name 440 * @param scope the permission scope 441 * @param primKey the primary key of the resource's class 442 * @param actionId the name of the resource action 443 * @return the roles 444 * @throws SystemException if a system exception occurred 445 * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P_A( 446 long, String, int, String, String) 447 */ 448 public java.util.List<com.liferay.portal.model.Role> getResourceRoles( 449 long companyId, java.lang.String name, int scope, 450 java.lang.String primKey, java.lang.String actionId) 451 throws com.liferay.portal.kernel.exception.SystemException { 452 return _roleLocalService.getResourceRoles(companyId, name, scope, 453 primKey, actionId); 454 } 455 456 /** 457 * Returns the role with the name in the company. 458 * 459 * <p> 460 * The method searches the system roles map first for default roles. If a 461 * role with the name is not found, then the method will query the 462 * database. 463 * </p> 464 * 465 * @param companyId the primary key of the company 466 * @param name the role's name 467 * @return the role with the name 468 * @throws PortalException if a role with the name could not be found in 469 the company 470 * @throws SystemException if a system exception occurred 471 */ 472 public com.liferay.portal.model.Role getRole(long companyId, 473 java.lang.String name) 474 throws com.liferay.portal.kernel.exception.PortalException, 475 com.liferay.portal.kernel.exception.SystemException { 476 return _roleLocalService.getRole(companyId, name); 477 } 478 479 /** 480 * Returns all the roles of the type and subtype. 481 * 482 * @param type the role's type (optionally <code>0</code>) 483 * @param subtype the role's subtype (optionally <code>null</code>) 484 * @return the roles of the type and subtype 485 * @throws SystemException if a system exception occurred 486 */ 487 public java.util.List<com.liferay.portal.model.Role> getRoles(int type, 488 java.lang.String subtype) 489 throws com.liferay.portal.kernel.exception.SystemException { 490 return _roleLocalService.getRoles(type, subtype); 491 } 492 493 /** 494 * Returns all the roles in the company. 495 * 496 * @param companyId the primary key of the company 497 * @return the roles in the company 498 * @throws SystemException if a system exception occurred 499 */ 500 public java.util.List<com.liferay.portal.model.Role> getRoles( 501 long companyId) 502 throws com.liferay.portal.kernel.exception.SystemException { 503 return _roleLocalService.getRoles(companyId); 504 } 505 506 /** 507 * Returns all the roles with the primary keys. 508 * 509 * @param roleIds the primary keys of the roles 510 * @return the roles with the primary keys 511 * @throws PortalException if any one of the roles with the primary keys 512 could not be found 513 * @throws SystemException if a system exception occurred 514 */ 515 public java.util.List<com.liferay.portal.model.Role> getRoles( 516 long[] roleIds) 517 throws com.liferay.portal.kernel.exception.PortalException, 518 com.liferay.portal.kernel.exception.SystemException { 519 return _roleLocalService.getRoles(roleIds); 520 } 521 522 /** 523 * Returns all the roles of the subtype. 524 * 525 * @param subtype the role's subtype (optionally <code>null</code>) 526 * @return the roles of the subtype 527 * @throws SystemException if a system exception occurred 528 */ 529 public java.util.List<com.liferay.portal.model.Role> getSubtypeRoles( 530 java.lang.String subtype) 531 throws com.liferay.portal.kernel.exception.SystemException { 532 return _roleLocalService.getSubtypeRoles(subtype); 533 } 534 535 /** 536 * Returns the number of roles of the subtype. 537 * 538 * @param subtype the role's subtype (optionally <code>null</code>) 539 * @return the number of roles of the subtype 540 * @throws SystemException if a system exception occurred 541 */ 542 public int getSubtypeRolesCount(java.lang.String subtype) 543 throws com.liferay.portal.kernel.exception.SystemException { 544 return _roleLocalService.getSubtypeRolesCount(subtype); 545 } 546 547 /** 548 * Returns the team role in the company. 549 * 550 * @param companyId the primary key of the company 551 * @param teamId the primary key of the team 552 * @return the team role in the company 553 * @throws PortalException if a role could not be found in the team and 554 company 555 * @throws SystemException if a system exception occurred 556 */ 557 public com.liferay.portal.model.Role getTeamRole(long companyId, long teamId) 558 throws com.liferay.portal.kernel.exception.PortalException, 559 com.liferay.portal.kernel.exception.SystemException { 560 return _roleLocalService.getTeamRole(companyId, teamId); 561 } 562 563 /** 564 * Returns all the user's roles within the user group. 565 * 566 * @param userId the primary key of the user 567 * @param groupId the primary key of the group 568 * @return the user's roles within the user group 569 * @throws SystemException if a system exception occurred 570 * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupGroupRole( 571 long, long) 572 */ 573 public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles( 574 long userId, long groupId) 575 throws com.liferay.portal.kernel.exception.SystemException { 576 return _roleLocalService.getUserGroupGroupRoles(userId, groupId); 577 } 578 579 /** 580 * Returns all the user's roles within the user group. 581 * 582 * @param userId the primary key of the user 583 * @param groupId the primary key of the group 584 * @return the user's roles within the user group 585 * @throws SystemException if a system exception occurred 586 * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupRole( 587 long, long) 588 */ 589 public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles( 590 long userId, long groupId) 591 throws com.liferay.portal.kernel.exception.SystemException { 592 return _roleLocalService.getUserGroupRoles(userId, groupId); 593 } 594 595 /** 596 * Returns the union of all the user's roles within the groups. 597 * 598 * @param userId the primary key of the user 599 * @param groups the groups (optionally <code>null</code>) 600 * @return the union of all the user's roles within the groups 601 * @throws SystemException if a system exception occurred 602 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 603 long, List) 604 */ 605 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 606 long userId, java.util.List<com.liferay.portal.model.Group> groups) 607 throws com.liferay.portal.kernel.exception.SystemException { 608 return _roleLocalService.getUserRelatedRoles(userId, groups); 609 } 610 611 /** 612 * Returns all the user's roles within the group. 613 * 614 * @param userId the primary key of the user 615 * @param groupId the primary key of the group 616 * @return the user's roles within the group 617 * @throws SystemException if a system exception occurred 618 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 619 long, long) 620 */ 621 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 622 long userId, long groupId) 623 throws com.liferay.portal.kernel.exception.SystemException { 624 return _roleLocalService.getUserRelatedRoles(userId, groupId); 625 } 626 627 /** 628 * Returns the union of all the user's roles within the groups. 629 * 630 * @param userId the primary key of the user 631 * @param groupIds the primary keys of the groups 632 * @return the union of all the user's roles within the groups 633 * @throws SystemException if a system exception occurred 634 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 635 long, long[]) 636 */ 637 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 638 long userId, long[] groupIds) 639 throws com.liferay.portal.kernel.exception.SystemException { 640 return _roleLocalService.getUserRelatedRoles(userId, groupIds); 641 } 642 643 /** 644 * Returns all the roles associated with the user. 645 * 646 * @param userId the primary key of the user 647 * @return the roles associated with the user 648 * @throws SystemException if a system exception occurred 649 */ 650 public java.util.List<com.liferay.portal.model.Role> getUserRoles( 651 long userId) throws com.liferay.portal.kernel.exception.SystemException { 652 return _roleLocalService.getUserRoles(userId); 653 } 654 655 /** 656 * Returns <code>true</code> if the user is associated with the role. 657 * 658 * @param userId the primary key of the user 659 * @param roleId the primary key of the role 660 * @return <code>true</code> if the user is associated with the role; 661 <code>false</code> otherwise 662 * @throws SystemException if a system exception occurred 663 */ 664 public boolean hasUserRole(long userId, long roleId) 665 throws com.liferay.portal.kernel.exception.SystemException { 666 return _roleLocalService.hasUserRole(userId, roleId); 667 } 668 669 /** 670 * Returns <code>true</code> if the user is associated with the named 671 * regular role. 672 * 673 * @param userId the primary key of the user 674 * @param companyId the primary key of the company 675 * @param name the name of the role 676 * @param inherited whether to include the user's inherited roles in the 677 search 678 * @return <code>true</code> if the user is associated with the regular 679 role; <code>false</code> otherwise 680 * @throws PortalException if a role with the name could not be found in 681 the company or if a default user for the company could not be 682 found 683 * @throws SystemException if a system exception occurred 684 */ 685 public boolean hasUserRole(long userId, long companyId, 686 java.lang.String name, boolean inherited) 687 throws com.liferay.portal.kernel.exception.PortalException, 688 com.liferay.portal.kernel.exception.SystemException { 689 return _roleLocalService.hasUserRole(userId, companyId, name, inherited); 690 } 691 692 /** 693 * Returns <code>true</code> if the user has any one of the named regular 694 * roles. 695 * 696 * @param userId the primary key of the user 697 * @param companyId the primary key of the company 698 * @param names the names of the roles 699 * @param inherited whether to include the user's inherited roles in the 700 search 701 * @return <code>true</code> if the user has any one of the regular roles; 702 <code>false</code> otherwise 703 * @throws PortalException if any one of the roles with the names could not 704 be found in the company or if the default user for the company 705 could not be found 706 * @throws SystemException if a system exception occurred 707 */ 708 public boolean hasUserRoles(long userId, long companyId, 709 java.lang.String[] names, boolean inherited) 710 throws com.liferay.portal.kernel.exception.PortalException, 711 com.liferay.portal.kernel.exception.SystemException { 712 return _roleLocalService.hasUserRoles(userId, companyId, names, 713 inherited); 714 } 715 716 /** 717 * Returns a role with the name in the company. 718 * 719 * @param companyId the primary key of the company 720 * @param name the role's name (optionally <code>null</code>) 721 * @return the role with the name, or <code>null</code> if a role with the 722 name could not be found in the company 723 * @throws SystemException if a system exception occurred 724 */ 725 public com.liferay.portal.model.Role loadFetchRole(long companyId, 726 java.lang.String name) 727 throws com.liferay.portal.kernel.exception.SystemException { 728 return _roleLocalService.loadFetchRole(companyId, name); 729 } 730 731 /** 732 * Returns a role with the name in the company. 733 * 734 * @param companyId the primary key of the company 735 * @param name the role's name 736 * @return the role with the name in the company 737 * @throws PortalException if a role with the name could not be found in 738 the company 739 * @throws SystemException if a system exception occurred 740 */ 741 public com.liferay.portal.model.Role loadGetRole(long companyId, 742 java.lang.String name) 743 throws com.liferay.portal.kernel.exception.PortalException, 744 com.liferay.portal.kernel.exception.SystemException { 745 return _roleLocalService.loadGetRole(companyId, name); 746 } 747 748 /** 749 * Returns an ordered range of all the roles that match the keywords and 750 * types. 751 * 752 * <p> 753 * Useful when paginating results. Returns a maximum of <code>end - 754 * start</code> instances. <code>start</code> and <code>end</code> are not 755 * primary keys, they are indexes in the result set. Thus, <code>0</code> 756 * refers to the first result in the set. Setting both <code>start</code> 757 * and <code>end</code> to {@link 758 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the 759 * full result set. 760 * </p> 761 * 762 * @param companyId the primary key of the company 763 * @param keywords the keywords (space separated), which may occur in the 764 role's name or description (optionally <code>null</code>) 765 * @param types the role types (optionally <code>null</code>) 766 * @param start the lower bound of the range of roles to return 767 * @param end the upper bound of the range of roles to return (not 768 inclusive) 769 * @param obc the comparator to order the roles (optionally 770 <code>null</code>) 771 * @return the ordered range of the matching roles, ordered by 772 <code>obc</code> 773 * @throws SystemException if a system exception occurred 774 * @see com.liferay.portal.service.persistence.RoleFinder 775 */ 776 public java.util.List<com.liferay.portal.model.Role> search( 777 long companyId, java.lang.String keywords, java.lang.Integer[] types, 778 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 779 throws com.liferay.portal.kernel.exception.SystemException { 780 return _roleLocalService.search(companyId, keywords, types, start, end, 781 obc); 782 } 783 784 /** 785 * Returns an ordered range of all the roles that match the keywords, 786 * types, and params. 787 * 788 * <p> 789 * Useful when paginating results. Returns a maximum of <code>end - 790 * start</code> instances. <code>start</code> and <code>end</code> are not 791 * primary keys, they are indexes in the result set. Thus, <code>0</code> 792 * refers to the first result in the set. Setting both <code>start</code> 793 * and <code>end</code> to {@link 794 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the 795 * full result set. 796 * </p> 797 * 798 * @param companyId the primary key of the company 799 * @param keywords the keywords (space separated), which may occur in the 800 role's name or description (optionally <code>null</code>) 801 * @param types the role types (optionally <code>null</code>) 802 * @param params the finder parameters. Can specify values for 803 "permissionsResourceId" and "usersRoles" keys. For more 804 information, see {@link 805 com.liferay.portal.service.persistence.RoleFinder} 806 * @param start the lower bound of the range of roles to return 807 * @param end the upper bound of the range of roles to return (not 808 inclusive) 809 * @param obc the comparator to order the roles (optionally 810 <code>null</code>) 811 * @return the ordered range of the matching roles, ordered by 812 <code>obc</code> 813 * @throws SystemException if a system exception occurred 814 * @see com.liferay.portal.service.persistence.RoleFinder 815 */ 816 public java.util.List<com.liferay.portal.model.Role> search( 817 long companyId, java.lang.String keywords, java.lang.Integer[] types, 818 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 819 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 820 throws com.liferay.portal.kernel.exception.SystemException { 821 return _roleLocalService.search(companyId, keywords, types, params, 822 start, end, obc); 823 } 824 825 /** 826 * Returns an ordered range of all the roles that match the name, 827 * description, and types. 828 * 829 * <p> 830 * Useful when paginating results. Returns a maximum of <code>end - 831 * start</code> instances. <code>start</code> and <code>end</code> are not 832 * primary keys, they are indexes in the result set. Thus, <code>0</code> 833 * refers to the first result in the set. Setting both <code>start</code> 834 * and <code>end</code> to {@link 835 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the 836 * full result set. 837 * </p> 838 * 839 * @param companyId the primary key of the company 840 * @param name the role's name (optionally <code>null</code>) 841 * @param description the role's description (optionally 842 <code>null</code>) 843 * @param types the role types (optionally <code>null</code>) 844 * @param start the lower bound of the range of the roles to return 845 * @param end the upper bound of the range of the roles to return (not 846 inclusive) 847 * @param obc the comparator to order the roles (optionally 848 <code>null</code>) 849 * @return the ordered range of the matching roles, ordered by 850 <code>obc</code> 851 * @throws SystemException if a system exception occurred 852 * @see com.liferay.portal.service.persistence.RoleFinder 853 */ 854 public java.util.List<com.liferay.portal.model.Role> search( 855 long companyId, java.lang.String name, java.lang.String description, 856 java.lang.Integer[] types, int start, int end, 857 com.liferay.portal.kernel.util.OrderByComparator obc) 858 throws com.liferay.portal.kernel.exception.SystemException { 859 return _roleLocalService.search(companyId, name, description, types, 860 start, end, obc); 861 } 862 863 /** 864 * Returns an ordered range of all the roles that match the name, 865 * description, types, and params. 866 * 867 * <p> 868 * Useful when paginating results. Returns a maximum of <code>end - 869 * start</code> instances. <code>start</code> and <code>end</code> are not 870 * primary keys, they are indexes in the result set. Thus, <code>0</code> 871 * refers to the first result in the set. Setting both <code>start</code> 872 * and <code>end</code> to {@link 873 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the 874 * full result set. 875 * </p> 876 * 877 * @param companyId the primary key of the company 878 * @param name the role's name (optionally <code>null</code>) 879 * @param description the role's description (optionally 880 <code>null</code>) 881 * @param types the role types (optionally <code>null</code>) 882 * @param params the finder's parameters. Can specify values for 883 "permissionsResourceId" and "usersRoles" keys. For more 884 information, see {@link 885 com.liferay.portal.service.persistence.RoleFinder} 886 * @param start the lower bound of the range of the roles to return 887 * @param end the upper bound of the range of the roles to return (not 888 inclusive) 889 * @param obc the comparator to order the roles (optionally 890 <code>null</code>) 891 * @return the ordered range of the matching roles, ordered by 892 <code>obc</code> 893 * @throws SystemException if a system exception occurred 894 * @see com.liferay.portal.service.persistence.RoleFinder 895 */ 896 public java.util.List<com.liferay.portal.model.Role> search( 897 long companyId, java.lang.String name, java.lang.String description, 898 java.lang.Integer[] types, 899 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 900 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 901 throws com.liferay.portal.kernel.exception.SystemException { 902 return _roleLocalService.search(companyId, name, description, types, 903 params, start, end, obc); 904 } 905 906 /** 907 * Returns the number of roles that match the keywords and types. 908 * 909 * @param companyId the primary key of the company 910 * @param keywords the keywords (space separated), which may occur in the 911 role's name or description (optionally <code>null</code>) 912 * @param types the role types (optionally <code>null</code>) 913 * @return the number of matching roles 914 * @throws SystemException if a system exception occurred 915 */ 916 public int searchCount(long companyId, java.lang.String keywords, 917 java.lang.Integer[] types) 918 throws com.liferay.portal.kernel.exception.SystemException { 919 return _roleLocalService.searchCount(companyId, keywords, types); 920 } 921 922 /** 923 * Returns the number of roles that match the keywords, types and params. 924 * 925 * @param companyId the primary key of the company 926 * @param keywords the keywords (space separated), which may occur in the 927 role's name or description (optionally <code>null</code>) 928 * @param types the role types (optionally <code>null</code>) 929 * @param params the finder parameters. For more information, see {@link 930 com.liferay.portal.service.persistence.RoleFinder} 931 * @return the number of matching roles 932 * @throws SystemException if a system exception occurred 933 */ 934 public int searchCount(long companyId, java.lang.String keywords, 935 java.lang.Integer[] types, 936 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 937 throws com.liferay.portal.kernel.exception.SystemException { 938 return _roleLocalService.searchCount(companyId, keywords, types, params); 939 } 940 941 /** 942 * Returns the number of roles that match the name, description, and types. 943 * 944 * @param companyId the primary key of the company 945 * @param name the role's name (optionally <code>null</code>) 946 * @param description the role's description (optionally 947 <code>null</code>) 948 * @param types the role types (optionally <code>null</code>) 949 * @return the number of matching roles 950 * @throws SystemException if a system exception occurred 951 */ 952 public int searchCount(long companyId, java.lang.String name, 953 java.lang.String description, java.lang.Integer[] types) 954 throws com.liferay.portal.kernel.exception.SystemException { 955 return _roleLocalService.searchCount(companyId, name, description, types); 956 } 957 958 /** 959 * Returns the number of roles that match the name, description, types, and 960 * params. 961 * 962 * @param companyId the primary key of the company 963 * @param name the role's name (optionally <code>null</code>) 964 * @param description the role's description (optionally 965 <code>null</code>) 966 * @param types the role types (optionally <code>null</code>) 967 * @param params the finder parameters. Can specify values for 968 "permissionsResourceId" and "usersRoles" keys. For more 969 information, see {@link 970 com.liferay.portal.service.persistence.RoleFinder} 971 * @return the number of matching roles 972 * @throws SystemException if a system exception occurred 973 */ 974 public int searchCount(long companyId, java.lang.String name, 975 java.lang.String description, java.lang.Integer[] types, 976 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 977 throws com.liferay.portal.kernel.exception.SystemException { 978 return _roleLocalService.searchCount(companyId, name, description, 979 types, params); 980 } 981 982 /** 983 * Sets the roles associated with the user, replacing the user's existing 984 * roles. The user is reindexed after the roles are set. 985 * 986 * @param userId the primary key of the user 987 * @param roleIds the primary keys of the roles 988 * @throws PortalException if a user with the primary could not be found or 989 if any one of the roles with the primary keys could not be found 990 * @throws SystemException if a system exception occurred 991 */ 992 public void setUserRoles(long userId, long[] roleIds) 993 throws com.liferay.portal.kernel.exception.PortalException, 994 com.liferay.portal.kernel.exception.SystemException { 995 _roleLocalService.setUserRoles(userId, roleIds); 996 } 997 998 /** 999 * Removes the matching roles associated with the user. The user is 1000 * reindexed after the roles are removed. 1001 * 1002 * @param userId the primary key of the user 1003 * @param roleIds the primary keys of the roles 1004 * @throws PortalException if a user with the primary key could not be 1005 found or if a role with any one of the primary keys could not be 1006 found 1007 * @throws SystemException if a system exception occurred 1008 */ 1009 public void unsetUserRoles(long userId, long[] roleIds) 1010 throws com.liferay.portal.kernel.exception.PortalException, 1011 com.liferay.portal.kernel.exception.SystemException { 1012 _roleLocalService.unsetUserRoles(userId, roleIds); 1013 } 1014 1015 /** 1016 * Updates the role with the primary key. 1017 * 1018 * @param roleId the primary key of the role 1019 * @param name the role's new name 1020 * @param titleMap the new localized titles (optionally <code>null</code>) 1021 to replace those existing for the role 1022 * @param descriptionMap the new localized descriptions (optionally 1023 <code>null</code>) to replace those existing for the role 1024 * @param subtype the role's new subtype (optionally <code>null</code>) 1025 * @return the role with the primary key 1026 * @throws PortalException if a role with the primary could not be found or 1027 if the role's name was invalid 1028 * @throws SystemException if a system exception occurred 1029 */ 1030 public com.liferay.portal.model.Role updateRole(long roleId, 1031 java.lang.String name, 1032 java.util.Map<java.util.Locale, java.lang.String> titleMap, 1033 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 1034 java.lang.String subtype) 1035 throws com.liferay.portal.kernel.exception.PortalException, 1036 com.liferay.portal.kernel.exception.SystemException { 1037 return _roleLocalService.updateRole(roleId, name, titleMap, 1038 descriptionMap, subtype); 1039 } 1040 1041 public RoleLocalService getWrappedRoleLocalService() { 1042 return _roleLocalService; 1043 } 1044 1045 public void setWrappedRoleLocalService(RoleLocalService roleLocalService) { 1046 _roleLocalService = roleLocalService; 1047 } 1048 1049 private RoleLocalService _roleLocalService; 1050 }