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