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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 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 * @throws SystemException if a system exception occurred 216 */ 217 public void addGroupRole(long groupId, long roleId) 218 throws com.liferay.portal.kernel.exception.SystemException; 219 220 /** 221 * @throws SystemException if a system exception occurred 222 */ 223 public void addGroupRole(long groupId, com.liferay.portal.model.Role role) 224 throws com.liferay.portal.kernel.exception.SystemException; 225 226 /** 227 * @throws SystemException if a system exception occurred 228 */ 229 public void addGroupRoles(long groupId, long[] roleIds) 230 throws com.liferay.portal.kernel.exception.SystemException; 231 232 /** 233 * @throws SystemException if a system exception occurred 234 */ 235 public void addGroupRoles(long groupId, 236 java.util.List<com.liferay.portal.model.Role> Roles) 237 throws com.liferay.portal.kernel.exception.SystemException; 238 239 /** 240 * @throws SystemException if a system exception occurred 241 */ 242 public void clearGroupRoles(long groupId) 243 throws com.liferay.portal.kernel.exception.SystemException; 244 245 /** 246 * @throws SystemException if a system exception occurred 247 */ 248 public void deleteGroupRole(long groupId, long roleId) 249 throws com.liferay.portal.kernel.exception.SystemException; 250 251 /** 252 * @throws SystemException if a system exception occurred 253 */ 254 public void deleteGroupRole(long groupId, com.liferay.portal.model.Role role) 255 throws com.liferay.portal.kernel.exception.SystemException; 256 257 /** 258 * @throws SystemException if a system exception occurred 259 */ 260 public void deleteGroupRoles(long groupId, long[] roleIds) 261 throws com.liferay.portal.kernel.exception.SystemException; 262 263 /** 264 * @throws SystemException if a system exception occurred 265 */ 266 public void deleteGroupRoles(long groupId, 267 java.util.List<com.liferay.portal.model.Role> Roles) 268 throws com.liferay.portal.kernel.exception.SystemException; 269 270 /** 271 * @throws SystemException if a system exception occurred 272 */ 273 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 274 public java.util.List<com.liferay.portal.model.Role> getGroupRoles( 275 long groupId) 276 throws com.liferay.portal.kernel.exception.SystemException; 277 278 /** 279 * @throws SystemException if a system exception occurred 280 */ 281 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 282 public java.util.List<com.liferay.portal.model.Role> getGroupRoles( 283 long groupId, int start, int end) 284 throws com.liferay.portal.kernel.exception.SystemException; 285 286 /** 287 * @throws SystemException if a system exception occurred 288 */ 289 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 290 public java.util.List<com.liferay.portal.model.Role> getGroupRoles( 291 long groupId, int start, int end, 292 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 293 throws com.liferay.portal.kernel.exception.SystemException; 294 295 /** 296 * @throws SystemException if a system exception occurred 297 */ 298 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 299 public int getGroupRolesCount(long groupId) 300 throws com.liferay.portal.kernel.exception.SystemException; 301 302 /** 303 * @throws SystemException if a system exception occurred 304 */ 305 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 306 public boolean hasGroupRole(long groupId, long roleId) 307 throws com.liferay.portal.kernel.exception.SystemException; 308 309 /** 310 * @throws SystemException if a system exception occurred 311 */ 312 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 313 public boolean hasGroupRoles(long groupId) 314 throws com.liferay.portal.kernel.exception.SystemException; 315 316 /** 317 * @throws SystemException if a system exception occurred 318 */ 319 public void setGroupRoles(long groupId, long[] roleIds) 320 throws com.liferay.portal.kernel.exception.SystemException; 321 322 /** 323 * @throws SystemException if a system exception occurred 324 */ 325 public void addUserRole(long userId, long roleId) 326 throws com.liferay.portal.kernel.exception.SystemException; 327 328 /** 329 * @throws SystemException if a system exception occurred 330 */ 331 public void addUserRole(long userId, com.liferay.portal.model.Role role) 332 throws com.liferay.portal.kernel.exception.SystemException; 333 334 /** 335 * @throws PortalException 336 * @throws SystemException if a system exception occurred 337 */ 338 public void addUserRoles(long userId, long[] roleIds) 339 throws com.liferay.portal.kernel.exception.PortalException, 340 com.liferay.portal.kernel.exception.SystemException; 341 342 /** 343 * @throws PortalException 344 * @throws SystemException if a system exception occurred 345 */ 346 public void addUserRoles(long userId, 347 java.util.List<com.liferay.portal.model.Role> Roles) 348 throws com.liferay.portal.kernel.exception.PortalException, 349 com.liferay.portal.kernel.exception.SystemException; 350 351 /** 352 * @throws SystemException if a system exception occurred 353 */ 354 public void clearUserRoles(long userId) 355 throws com.liferay.portal.kernel.exception.SystemException; 356 357 /** 358 * @throws SystemException if a system exception occurred 359 */ 360 public void deleteUserRole(long userId, long roleId) 361 throws com.liferay.portal.kernel.exception.SystemException; 362 363 /** 364 * @throws SystemException if a system exception occurred 365 */ 366 public void deleteUserRole(long userId, com.liferay.portal.model.Role role) 367 throws com.liferay.portal.kernel.exception.SystemException; 368 369 /** 370 * @throws SystemException if a system exception occurred 371 */ 372 public void deleteUserRoles(long userId, long[] roleIds) 373 throws com.liferay.portal.kernel.exception.SystemException; 374 375 /** 376 * @throws SystemException if a system exception occurred 377 */ 378 public void deleteUserRoles(long userId, 379 java.util.List<com.liferay.portal.model.Role> Roles) 380 throws com.liferay.portal.kernel.exception.SystemException; 381 382 /** 383 * @throws SystemException if a system exception occurred 384 */ 385 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 386 public java.util.List<com.liferay.portal.model.Role> getUserRoles( 387 long userId) throws com.liferay.portal.kernel.exception.SystemException; 388 389 /** 390 * @throws SystemException if a system exception occurred 391 */ 392 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 393 public java.util.List<com.liferay.portal.model.Role> getUserRoles( 394 long userId, int start, int end) 395 throws com.liferay.portal.kernel.exception.SystemException; 396 397 /** 398 * @throws SystemException if a system exception occurred 399 */ 400 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 401 public java.util.List<com.liferay.portal.model.Role> getUserRoles( 402 long userId, int start, int end, 403 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 404 throws com.liferay.portal.kernel.exception.SystemException; 405 406 /** 407 * @throws SystemException if a system exception occurred 408 */ 409 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 410 public int getUserRolesCount(long userId) 411 throws com.liferay.portal.kernel.exception.SystemException; 412 413 /** 414 * @throws SystemException if a system exception occurred 415 */ 416 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 417 public boolean hasUserRole(long userId, long roleId) 418 throws com.liferay.portal.kernel.exception.SystemException; 419 420 /** 421 * @throws SystemException if a system exception occurred 422 */ 423 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 424 public boolean hasUserRoles(long userId) 425 throws com.liferay.portal.kernel.exception.SystemException; 426 427 /** 428 * @throws PortalException 429 * @throws SystemException if a system exception occurred 430 */ 431 public void setUserRoles(long userId, long[] roleIds) 432 throws com.liferay.portal.kernel.exception.PortalException, 433 com.liferay.portal.kernel.exception.SystemException; 434 435 /** 436 * Returns the Spring bean ID for this bean. 437 * 438 * @return the Spring bean ID for this bean 439 */ 440 public java.lang.String getBeanIdentifier(); 441 442 /** 443 * Sets the Spring bean ID for this bean. 444 * 445 * @param beanIdentifier the Spring bean ID for this bean 446 */ 447 public void setBeanIdentifier(java.lang.String beanIdentifier); 448 449 /** 450 * Adds a role. The user is reindexed after role is added. 451 * 452 * @param userId the primary key of the user 453 * @param companyId the primary key of the company 454 * @param name the role's name 455 * @param titleMap the role's localized titles (optionally 456 <code>null</code>) 457 * @param descriptionMap the role's localized descriptions (optionally 458 <code>null</code>) 459 * @param type the role's type (optionally <code>0</code>) 460 * @return the role 461 * @throws PortalException if the class name or the role name were 462 invalid, if the role is a duplicate, or if a user with the 463 primary key could not be found 464 * @throws SystemException if a system exception occurred 465 * @deprecated As of 6.2.0, replaced by {@link #addRole(long, String, long, 466 String, Map, Map, int, String, ServiceContext)} 467 */ 468 public com.liferay.portal.model.Role addRole(long userId, long companyId, 469 java.lang.String name, 470 java.util.Map<java.util.Locale, java.lang.String> titleMap, 471 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 472 int type) 473 throws com.liferay.portal.kernel.exception.PortalException, 474 com.liferay.portal.kernel.exception.SystemException; 475 476 /** 477 * Adds a role with additional parameters. The user is reindexed after role 478 * is added. 479 * 480 * @param userId the primary key of the user 481 * @param companyId the primary key of the company 482 * @param name the role's name 483 * @param titleMap the role's localized titles (optionally 484 <code>null</code>) 485 * @param descriptionMap the role's localized descriptions (optionally 486 <code>null</code>) 487 * @param type the role's type (optionally <code>0</code>) 488 * @param className the name of the class for which the role is created 489 (optionally <code>null</code>) 490 * @param classPK the primary key of the class for which the role is 491 created (optionally <code>0</code>) 492 * @return the role 493 * @throws PortalException if the class name or the role name were 494 invalid, if the role is a duplicate, or if a user with the 495 primary key could not be found 496 * @throws SystemException if a system exception occurred 497 * @deprecated As of 6.2.0, replaced by {@link #addRole(long, String, long, 498 String, Map, Map, int, String, ServiceContext)} 499 */ 500 public com.liferay.portal.model.Role addRole(long userId, long companyId, 501 java.lang.String name, 502 java.util.Map<java.util.Locale, java.lang.String> titleMap, 503 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 504 int type, java.lang.String className, long classPK) 505 throws com.liferay.portal.kernel.exception.PortalException, 506 com.liferay.portal.kernel.exception.SystemException; 507 508 /** 509 * Adds a role with additional parameters. The user is reindexed after role 510 * is added. 511 * 512 * @param userId the primary key of the user 513 * @param className the name of the class for which the role is created 514 (optionally <code>null</code>) 515 * @param classPK the primary key of the class for which the role is 516 created (optionally <code>0</code>) 517 * @param name the role's name 518 * @param titleMap the role's localized titles (optionally 519 <code>null</code>) 520 * @param descriptionMap the role's localized descriptions (optionally 521 <code>null</code>) 522 * @param type the role's type (optionally <code>0</code>) 523 * @param subType the role's subtype (optionally <code>null</code>) 524 * @param serviceContext the service context to be applied (optionally 525 <code>null</code>). Can set expando bridge attributes for the 526 role. 527 * @return the role 528 * @throws PortalException if the class name or the role name were invalid, 529 if the role is a duplicate, or if a user with the primary key 530 could not be found 531 * @throws SystemException if a system exception occurred 532 */ 533 public com.liferay.portal.model.Role addRole(long userId, 534 java.lang.String className, long classPK, java.lang.String name, 535 java.util.Map<java.util.Locale, java.lang.String> titleMap, 536 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 537 int type, java.lang.String subType, 538 com.liferay.portal.service.ServiceContext serviceContext) 539 throws com.liferay.portal.kernel.exception.PortalException, 540 com.liferay.portal.kernel.exception.SystemException; 541 542 /** 543 * Checks to ensure that the system roles map has appropriate default roles 544 * in each company. 545 * 546 * @throws PortalException if the current user did not have permission to 547 set applicable permissions on a role 548 * @throws SystemException if a system exception occurred 549 */ 550 public void checkSystemRoles() 551 throws com.liferay.portal.kernel.exception.PortalException, 552 com.liferay.portal.kernel.exception.SystemException; 553 554 /** 555 * Checks to ensure that the system roles map has appropriate default roles 556 * in the company. 557 * 558 * @param companyId the primary key of the company 559 * @throws PortalException if the current user did not have permission to 560 set applicable permissions on a role 561 * @throws SystemException if a system exception occurred 562 */ 563 public void checkSystemRoles(long companyId) 564 throws com.liferay.portal.kernel.exception.PortalException, 565 com.liferay.portal.kernel.exception.SystemException; 566 567 /** 568 * Returns the role with the name in the company. 569 * 570 * <p> 571 * The method searches the system roles map first for default roles. If a 572 * role with the name is not found, then the method will query the database. 573 * </p> 574 * 575 * @param companyId the primary key of the company 576 * @param name the role's name 577 * @return Returns the role with the name or <code>null</code> if a role 578 with the name could not be found in the company 579 * @throws SystemException if a system exception occurred 580 */ 581 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 582 public com.liferay.portal.model.Role fetchRole(long companyId, 583 java.lang.String name) 584 throws com.liferay.portal.kernel.exception.SystemException; 585 586 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 587 public com.liferay.portal.model.Role fetchRoleByUuidAndCompanyId( 588 java.lang.String uuid, long companyId) 589 throws com.liferay.portal.kernel.exception.SystemException; 590 591 /** 592 * Returns the default role for the group with the primary key. 593 * 594 * <p> 595 * If the group is a site, then the default role is {@link 596 * com.liferay.portal.model.RoleConstants#SITE_MEMBER}. If the group is an 597 * organization, then the default role is {@link 598 * com.liferay.portal.model.RoleConstants#ORGANIZATION_USER}. If the group 599 * is a user or user group, then the default role is {@link 600 * com.liferay.portal.model.RoleConstants#POWER_USER}. For all other group 601 * types, the default role is {@link 602 * com.liferay.portal.model.RoleConstants#USER}. 603 * </p> 604 * 605 * @param groupId the primary key of the group 606 * @return the default role for the group with the primary key 607 * @throws PortalException if a group with the primary key could not be 608 found, or if a default role could not be found for the group 609 * @throws SystemException if a system exception occurred 610 */ 611 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 612 public com.liferay.portal.model.Role getDefaultGroupRole(long groupId) 613 throws com.liferay.portal.kernel.exception.PortalException, 614 com.liferay.portal.kernel.exception.SystemException; 615 616 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 617 public java.util.List<com.liferay.portal.model.Role> getResourceBlockRoles( 618 long resourceBlockId, java.lang.String className, 619 java.lang.String actionId) 620 throws com.liferay.portal.kernel.exception.SystemException; 621 622 /** 623 * Returns a map of role names to associated action IDs for the named 624 * resource in the company within the permission scope. 625 * 626 * @param companyId the primary key of the company 627 * @param name the resource name 628 * @param scope the permission scope 629 * @param primKey the primary key of the resource's class 630 * @return the role names and action IDs 631 * @throws SystemException if a system exception occurred 632 * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P( 633 long, String, int, String) 634 */ 635 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 636 public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles( 637 long companyId, java.lang.String name, int scope, 638 java.lang.String primKey) 639 throws com.liferay.portal.kernel.exception.SystemException; 640 641 /** 642 * Returns all the roles associated with the action ID in the company within 643 * the permission scope. 644 * 645 * @param companyId the primary key of the company 646 * @param name the resource name 647 * @param scope the permission scope 648 * @param primKey the primary key of the resource's class 649 * @param actionId the name of the resource action 650 * @return the roles 651 * @throws SystemException if a system exception occurred 652 * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P_A( 653 long, String, int, String, String) 654 */ 655 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 656 public java.util.List<com.liferay.portal.model.Role> getResourceRoles( 657 long companyId, java.lang.String name, int scope, 658 java.lang.String primKey, java.lang.String actionId) 659 throws com.liferay.portal.kernel.exception.SystemException; 660 661 /** 662 * Returns the role with the name in the company. 663 * 664 * <p> 665 * The method searches the system roles map first for default roles. If a 666 * role with the name is not found, then the method will query the database. 667 * </p> 668 * 669 * @param companyId the primary key of the company 670 * @param name the role's name 671 * @return the role with the name 672 * @throws PortalException if a role with the name could not be found in the 673 company 674 * @throws SystemException if a system exception occurred 675 */ 676 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 677 public com.liferay.portal.model.Role getRole(long companyId, 678 java.lang.String name) 679 throws com.liferay.portal.kernel.exception.PortalException, 680 com.liferay.portal.kernel.exception.SystemException; 681 682 /** 683 * Returns all the roles of the type and subtype. 684 * 685 * @param type the role's type (optionally <code>0</code>) 686 * @param subtype the role's subtype (optionally <code>null</code>) 687 * @return the roles of the type and subtype 688 * @throws SystemException if a system exception occurred 689 */ 690 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 691 public java.util.List<com.liferay.portal.model.Role> getRoles(int type, 692 java.lang.String subtype) 693 throws com.liferay.portal.kernel.exception.SystemException; 694 695 /** 696 * Returns all the roles in the company. 697 * 698 * @param companyId the primary key of the company 699 * @return the roles in the company 700 * @throws SystemException if a system exception occurred 701 */ 702 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 703 public java.util.List<com.liferay.portal.model.Role> getRoles( 704 long companyId) 705 throws com.liferay.portal.kernel.exception.SystemException; 706 707 /** 708 * Returns all the roles with the primary keys. 709 * 710 * @param roleIds the primary keys of the roles 711 * @return the roles with the primary keys 712 * @throws PortalException if any one of the roles with the primary keys 713 could not be found 714 * @throws SystemException if a system exception occurred 715 */ 716 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 717 public java.util.List<com.liferay.portal.model.Role> getRoles( 718 long[] roleIds) 719 throws com.liferay.portal.kernel.exception.PortalException, 720 com.liferay.portal.kernel.exception.SystemException; 721 722 /** 723 * Returns all the roles of the subtype. 724 * 725 * @param subtype the role's subtype (optionally <code>null</code>) 726 * @return the roles of the subtype 727 * @throws SystemException if a system exception occurred 728 */ 729 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 730 public java.util.List<com.liferay.portal.model.Role> getSubtypeRoles( 731 java.lang.String subtype) 732 throws com.liferay.portal.kernel.exception.SystemException; 733 734 /** 735 * Returns the number of roles of the subtype. 736 * 737 * @param subtype the role's subtype (optionally <code>null</code>) 738 * @return the number of roles of the subtype 739 * @throws SystemException if a system exception occurred 740 */ 741 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 742 public int getSubtypeRolesCount(java.lang.String subtype) 743 throws com.liferay.portal.kernel.exception.SystemException; 744 745 /** 746 * Returns the team role in the company. 747 * 748 * @param companyId the primary key of the company 749 * @param teamId the primary key of the team 750 * @return the team role in the company 751 * @throws PortalException if a role could not be found in the team and 752 company 753 * @throws SystemException if a system exception occurred 754 */ 755 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 756 public com.liferay.portal.model.Role getTeamRole(long companyId, long teamId) 757 throws com.liferay.portal.kernel.exception.PortalException, 758 com.liferay.portal.kernel.exception.SystemException; 759 760 /** 761 * Returns all the roles of the type. 762 * 763 * @param type the role's type (optionally <code>0</code>) 764 * @return the range of the roles of the type 765 * @throws SystemException if a system exception occurred 766 */ 767 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 768 public java.util.List<com.liferay.portal.model.Role> getTypeRoles(int type) 769 throws com.liferay.portal.kernel.exception.SystemException; 770 771 /** 772 * Returns a range of all the roles of the type. 773 * 774 * @param type the role's type (optionally <code>0</code>) 775 * @param start the lower bound of the range of roles to return 776 * @param end the upper bound of the range of roles to return (not 777 inclusive) 778 * @return the range of the roles of the type 779 * @throws SystemException if a system exception occurred 780 */ 781 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 782 public java.util.List<com.liferay.portal.model.Role> getTypeRoles( 783 int type, int start, int end) 784 throws com.liferay.portal.kernel.exception.SystemException; 785 786 /** 787 * Returns the number of roles of the type. 788 * 789 * @param type the role's type (optionally <code>0</code>) 790 * @return the number of roles of the type 791 * @throws SystemException if a system exception occurred 792 */ 793 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 794 public int getTypeRolesCount(int type) 795 throws com.liferay.portal.kernel.exception.SystemException; 796 797 /** 798 * Returns all the user's roles within the user group. 799 * 800 * @param userId the primary key of the user 801 * @param groupId the primary key of the group 802 * @return the user's roles within the user group 803 * @throws SystemException if a system exception occurred 804 * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupGroupRole( 805 long, long) 806 */ 807 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 808 public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles( 809 long userId, long groupId) 810 throws com.liferay.portal.kernel.exception.SystemException; 811 812 /** 813 * Returns all the user's roles within the user group. 814 * 815 * @param userId the primary key of the user 816 * @param groupId the primary key of the group 817 * @return the user's roles within the user group 818 * @throws SystemException if a system exception occurred 819 * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupRole( 820 long, long) 821 */ 822 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 823 public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles( 824 long userId, long groupId) 825 throws com.liferay.portal.kernel.exception.SystemException; 826 827 /** 828 * Returns the union of all the user's roles within the groups. 829 * 830 * @param userId the primary key of the user 831 * @param groups the groups (optionally <code>null</code>) 832 * @return the union of all the user's roles within the groups 833 * @throws SystemException if a system exception occurred 834 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 835 long, List) 836 */ 837 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 838 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 839 long userId, java.util.List<com.liferay.portal.model.Group> groups) 840 throws com.liferay.portal.kernel.exception.SystemException; 841 842 /** 843 * Returns all the user's roles within the group. 844 * 845 * @param userId the primary key of the user 846 * @param groupId the primary key of the group 847 * @return the user's roles within the group 848 * @throws SystemException if a system exception occurred 849 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 850 long, long) 851 */ 852 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 853 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 854 long userId, long groupId) 855 throws com.liferay.portal.kernel.exception.SystemException; 856 857 /** 858 * Returns the union of all the user's roles within the groups. 859 * 860 * @param userId the primary key of the user 861 * @param groupIds the primary keys of the groups 862 * @return the union of all the user's roles within the groups 863 * @throws SystemException if a system exception occurred 864 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 865 long, long[]) 866 */ 867 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 868 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 869 long userId, long[] groupIds) 870 throws com.liferay.portal.kernel.exception.SystemException; 871 872 /** 873 * Returns <code>true</code> if the user is associated with the named 874 * regular role. 875 * 876 * @param userId the primary key of the user 877 * @param companyId the primary key of the company 878 * @param name the name of the role 879 * @param inherited whether to include the user's inherited roles in the 880 search 881 * @return <code>true</code> if the user is associated with the regular 882 role; <code>false</code> otherwise 883 * @throws PortalException if a default user for the company could not be 884 found 885 * @throws SystemException if a system exception occurred 886 */ 887 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 888 public boolean hasUserRole(long userId, long companyId, 889 java.lang.String name, boolean inherited) 890 throws com.liferay.portal.kernel.exception.PortalException, 891 com.liferay.portal.kernel.exception.SystemException; 892 893 /** 894 * Returns <code>true</code> if the user has any one of the named regular 895 * roles. 896 * 897 * @param userId the primary key of the user 898 * @param companyId the primary key of the company 899 * @param names the names of the roles 900 * @param inherited whether to include the user's inherited roles in the 901 search 902 * @return <code>true</code> if the user has any one of the regular roles; 903 <code>false</code> otherwise 904 * @throws PortalException if any one of the roles with the names could not 905 be found in the company or if the default user for the company 906 could not be found 907 * @throws SystemException if a system exception occurred 908 */ 909 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 910 public boolean hasUserRoles(long userId, long companyId, 911 java.lang.String[] names, boolean inherited) 912 throws com.liferay.portal.kernel.exception.PortalException, 913 com.liferay.portal.kernel.exception.SystemException; 914 915 /** 916 * Returns a role with the name in the company. 917 * 918 * @param companyId the primary key of the company 919 * @param name the role's name (optionally <code>null</code>) 920 * @return the role with the name, or <code>null</code> if a role with the 921 name could not be found in the company 922 * @throws SystemException if a system exception occurred 923 */ 924 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 925 public com.liferay.portal.model.Role loadFetchRole(long companyId, 926 java.lang.String name) 927 throws com.liferay.portal.kernel.exception.SystemException; 928 929 /** 930 * Returns a role with the name in the company. 931 * 932 * @param companyId the primary key of the company 933 * @param name the role's name 934 * @return the role with the name in the company 935 * @throws PortalException if a role with the name could not be found in the 936 company 937 * @throws SystemException if a system exception occurred 938 */ 939 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 940 public com.liferay.portal.model.Role loadGetRole(long companyId, 941 java.lang.String name) 942 throws com.liferay.portal.kernel.exception.PortalException, 943 com.liferay.portal.kernel.exception.SystemException; 944 945 /** 946 * Returns an ordered range of all the roles that match the keywords and 947 * types. 948 * 949 * <p> 950 * Useful when paginating results. Returns a maximum of <code>end - 951 * start</code> instances. <code>start</code> and <code>end</code> are not 952 * primary keys, they are indexes in the result set. Thus, <code>0</code> 953 * refers to the first result in the set. Setting both <code>start</code> 954 * and <code>end</code> to {@link 955 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 956 * result set. 957 * </p> 958 * 959 * @param companyId the primary key of the company 960 * @param keywords the keywords (space separated), which may occur in the 961 role's name or description (optionally <code>null</code>) 962 * @param types the role types (optionally <code>null</code>) 963 * @param start the lower bound of the range of roles to return 964 * @param end the upper bound of the range of roles to return (not 965 inclusive) 966 * @param obc the comparator to order the roles (optionally 967 <code>null</code>) 968 * @return the ordered range of the matching roles, ordered by 969 <code>obc</code> 970 * @throws SystemException if a system exception occurred 971 * @see com.liferay.portal.service.persistence.RoleFinder 972 */ 973 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 974 public java.util.List<com.liferay.portal.model.Role> search( 975 long companyId, java.lang.String keywords, java.lang.Integer[] types, 976 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 977 throws com.liferay.portal.kernel.exception.SystemException; 978 979 /** 980 * Returns an ordered range of all the roles that match the keywords, types, 981 * and params. 982 * 983 * <p> 984 * Useful when paginating results. Returns a maximum of <code>end - 985 * start</code> instances. <code>start</code> and <code>end</code> are not 986 * primary keys, they are indexes in the result set. Thus, <code>0</code> 987 * refers to the first result in the set. Setting both <code>start</code> 988 * and <code>end</code> to {@link 989 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 990 * result set. 991 * </p> 992 * 993 * @param companyId the primary key of the company 994 * @param keywords the keywords (space separated), which may occur in the 995 role's name or description (optionally <code>null</code>) 996 * @param types the role types (optionally <code>null</code>) 997 * @param params the finder parameters. Can specify values for the 998 "usersRoles" key. For more information, see {@link 999 com.liferay.portal.service.persistence.RoleFinder} 1000 * @param start the lower bound of the range of roles to return 1001 * @param end the upper bound of the range of roles to return (not 1002 inclusive) 1003 * @param obc the comparator to order the roles (optionally 1004 <code>null</code>) 1005 * @return the ordered range of the matching roles, ordered by 1006 <code>obc</code> 1007 * @throws SystemException if a system exception occurred 1008 * @see com.liferay.portal.service.persistence.RoleFinder 1009 */ 1010 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1011 public java.util.List<com.liferay.portal.model.Role> search( 1012 long companyId, java.lang.String keywords, java.lang.Integer[] types, 1013 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1014 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 1015 throws com.liferay.portal.kernel.exception.SystemException; 1016 1017 /** 1018 * Returns an ordered range of all the roles that match the name, 1019 * description, and types. 1020 * 1021 * <p> 1022 * Useful when paginating results. Returns a maximum of <code>end - 1023 * start</code> instances. <code>start</code> and <code>end</code> are not 1024 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1025 * refers to the first result in the set. Setting both <code>start</code> 1026 * and <code>end</code> to {@link 1027 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1028 * result set. 1029 * </p> 1030 * 1031 * @param companyId the primary key of the company 1032 * @param name the role's name (optionally <code>null</code>) 1033 * @param description the role's description (optionally <code>null</code>) 1034 * @param types the role types (optionally <code>null</code>) 1035 * @param start the lower bound of the range of the roles to return 1036 * @param end the upper bound of the range of the roles to return (not 1037 inclusive) 1038 * @param obc the comparator to order the roles (optionally 1039 <code>null</code>) 1040 * @return the ordered range of the matching roles, ordered by 1041 <code>obc</code> 1042 * @throws SystemException if a system exception occurred 1043 * @see com.liferay.portal.service.persistence.RoleFinder 1044 */ 1045 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1046 public java.util.List<com.liferay.portal.model.Role> search( 1047 long companyId, java.lang.String name, java.lang.String description, 1048 java.lang.Integer[] types, int start, int end, 1049 com.liferay.portal.kernel.util.OrderByComparator obc) 1050 throws com.liferay.portal.kernel.exception.SystemException; 1051 1052 /** 1053 * Returns an ordered range of all the roles that match the name, 1054 * description, types, and params. 1055 * 1056 * <p> 1057 * Useful when paginating results. Returns a maximum of <code>end - 1058 * start</code> instances. <code>start</code> and <code>end</code> are not 1059 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1060 * refers to the first result in the set. Setting both <code>start</code> 1061 * and <code>end</code> to {@link 1062 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1063 * result set. 1064 * </p> 1065 * 1066 * @param companyId the primary key of the company 1067 * @param name the role's name (optionally <code>null</code>) 1068 * @param description the role's description (optionally <code>null</code>) 1069 * @param types the role types (optionally <code>null</code>) 1070 * @param params the finder's parameters. Can specify values for the 1071 "usersRoles" key. For more information, see {@link 1072 com.liferay.portal.service.persistence.RoleFinder} 1073 * @param start the lower bound of the range of the roles to return 1074 * @param end the upper bound of the range of the roles to return (not 1075 inclusive) 1076 * @param obc the comparator to order the roles (optionally 1077 <code>null</code>) 1078 * @return the ordered range of the matching roles, ordered by 1079 <code>obc</code> 1080 * @throws SystemException if a system exception occurred 1081 * @see com.liferay.portal.service.persistence.RoleFinder 1082 */ 1083 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1084 public java.util.List<com.liferay.portal.model.Role> search( 1085 long companyId, java.lang.String name, java.lang.String description, 1086 java.lang.Integer[] types, 1087 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1088 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 1089 throws com.liferay.portal.kernel.exception.SystemException; 1090 1091 /** 1092 * Returns the number of roles that match the keywords and types. 1093 * 1094 * @param companyId the primary key of the company 1095 * @param keywords the keywords (space separated), which may occur in the 1096 role's name or description (optionally <code>null</code>) 1097 * @param types the role types (optionally <code>null</code>) 1098 * @return the number of matching roles 1099 * @throws SystemException if a system exception occurred 1100 */ 1101 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1102 public int searchCount(long companyId, java.lang.String keywords, 1103 java.lang.Integer[] types) 1104 throws com.liferay.portal.kernel.exception.SystemException; 1105 1106 /** 1107 * Returns the number of roles that match the keywords, types and params. 1108 * 1109 * @param companyId the primary key of the company 1110 * @param keywords the keywords (space separated), which may occur in the 1111 role's name or description (optionally <code>null</code>) 1112 * @param types the role types (optionally <code>null</code>) 1113 * @param params the finder parameters. For more information, see {@link 1114 com.liferay.portal.service.persistence.RoleFinder} 1115 * @return the number of matching roles 1116 * @throws SystemException if a system exception occurred 1117 */ 1118 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1119 public int searchCount(long companyId, java.lang.String keywords, 1120 java.lang.Integer[] types, 1121 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 1122 throws com.liferay.portal.kernel.exception.SystemException; 1123 1124 /** 1125 * Returns the number of roles that match the name, description, and types. 1126 * 1127 * @param companyId the primary key of the company 1128 * @param name the role's name (optionally <code>null</code>) 1129 * @param description the role's description (optionally <code>null</code>) 1130 * @param types the role types (optionally <code>null</code>) 1131 * @return the number of matching roles 1132 * @throws SystemException if a system exception occurred 1133 */ 1134 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1135 public int searchCount(long companyId, java.lang.String name, 1136 java.lang.String description, java.lang.Integer[] types) 1137 throws com.liferay.portal.kernel.exception.SystemException; 1138 1139 /** 1140 * Returns the number of roles that match the name, description, types, and 1141 * params. 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 parameters. Can specify values for the 1148 "usersRoles" key. For more information, see {@link 1149 com.liferay.portal.service.persistence.RoleFinder} 1150 * @return the number of matching roles 1151 * @throws SystemException if a system exception occurred 1152 */ 1153 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1154 public int searchCount(long companyId, java.lang.String name, 1155 java.lang.String description, java.lang.Integer[] types, 1156 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 1157 throws com.liferay.portal.kernel.exception.SystemException; 1158 1159 /** 1160 * Removes the matching roles associated with the user. The user is 1161 * reindexed after the roles are removed. 1162 * 1163 * @param userId the primary key of the user 1164 * @param roleIds the primary keys of the roles 1165 * @throws PortalException if a user with the primary key could not be found 1166 or if a role with any one of the primary keys could not be found 1167 * @throws SystemException if a system exception occurred 1168 */ 1169 public void unsetUserRoles(long userId, long[] roleIds) 1170 throws com.liferay.portal.kernel.exception.PortalException, 1171 com.liferay.portal.kernel.exception.SystemException; 1172 1173 /** 1174 * Updates the role with the primary key. 1175 * 1176 * @param roleId the primary key of the role 1177 * @param name the role's new name 1178 * @param titleMap the new localized titles (optionally <code>null</code>) 1179 to replace those existing for the role 1180 * @param descriptionMap the new localized descriptions (optionally 1181 <code>null</code>) to replace those existing for the role 1182 * @param subtype the role's new subtype (optionally <code>null</code>) 1183 * @param serviceContext the service context to be applied (optionally 1184 <code>null</code>). Can set expando bridge attributes for the 1185 role. 1186 * @return the role with the primary key 1187 * @throws PortalException if a role with the primary could not be found or 1188 if the role's name was invalid 1189 * @throws SystemException if a system exception occurred 1190 */ 1191 public com.liferay.portal.model.Role updateRole(long roleId, 1192 java.lang.String name, 1193 java.util.Map<java.util.Locale, java.lang.String> titleMap, 1194 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 1195 java.lang.String subtype, 1196 com.liferay.portal.service.ServiceContext serviceContext) 1197 throws com.liferay.portal.kernel.exception.PortalException, 1198 com.liferay.portal.kernel.exception.SystemException; 1199 }