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