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> getResourceBlockRoles( 654 long resourceBlockId, java.lang.String className, 655 java.lang.String actionId) 656 throws com.liferay.portal.kernel.exception.SystemException; 657 658 /** 659 * Returns a map of role names to associated action IDs for the named 660 * resource in the company within the permission scope. 661 * 662 * @param companyId the primary key of the company 663 * @param name the resource name 664 * @param scope the permission scope 665 * @param primKey the primary key of the resource's class 666 * @return the role names and action IDs 667 * @throws SystemException if a system exception occurred 668 * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P( 669 long, String, int, String) 670 */ 671 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 672 public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles( 673 long companyId, java.lang.String name, int scope, 674 java.lang.String primKey) 675 throws com.liferay.portal.kernel.exception.SystemException; 676 677 /** 678 * Returns all the roles associated with the action ID in the company within 679 * the permission scope. 680 * 681 * @param companyId the primary key of the company 682 * @param name the resource name 683 * @param scope the permission scope 684 * @param primKey the primary key of the resource's class 685 * @param actionId the name of the resource action 686 * @return the roles 687 * @throws SystemException if a system exception occurred 688 * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P_A( 689 long, String, int, String, String) 690 */ 691 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 692 public java.util.List<com.liferay.portal.model.Role> getResourceRoles( 693 long companyId, java.lang.String name, int scope, 694 java.lang.String primKey, java.lang.String actionId) 695 throws com.liferay.portal.kernel.exception.SystemException; 696 697 /** 698 * Returns the role with the name in the company. 699 * 700 * <p> 701 * The method searches the system roles map first for default roles. If a 702 * role with the name is not found, then the method will query the database. 703 * </p> 704 * 705 * @param companyId the primary key of the company 706 * @param name the role's name 707 * @return the role with the name 708 * @throws PortalException if a role with the name could not be found in the 709 company 710 * @throws SystemException if a system exception occurred 711 */ 712 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 713 public com.liferay.portal.model.Role getRole(long companyId, 714 java.lang.String name) 715 throws com.liferay.portal.kernel.exception.PortalException, 716 com.liferay.portal.kernel.exception.SystemException; 717 718 /** 719 * Returns all the roles of the type and subtype. 720 * 721 * @param type the role's type (optionally <code>0</code>) 722 * @param subtype the role's subtype (optionally <code>null</code>) 723 * @return the roles of the type and subtype 724 * @throws SystemException if a system exception occurred 725 */ 726 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 727 public java.util.List<com.liferay.portal.model.Role> getRoles(int type, 728 java.lang.String subtype) 729 throws com.liferay.portal.kernel.exception.SystemException; 730 731 /** 732 * Returns all the roles in the company. 733 * 734 * @param companyId the primary key of the company 735 * @return the roles in the company 736 * @throws SystemException if a system exception occurred 737 */ 738 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 739 public java.util.List<com.liferay.portal.model.Role> getRoles( 740 long companyId) 741 throws com.liferay.portal.kernel.exception.SystemException; 742 743 /** 744 * Returns all the roles with the primary keys. 745 * 746 * @param roleIds the primary keys of the roles 747 * @return the roles with the primary keys 748 * @throws PortalException if any one of the roles with the primary keys 749 could not be found 750 * @throws SystemException if a system exception occurred 751 */ 752 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 753 public java.util.List<com.liferay.portal.model.Role> getRoles( 754 long[] roleIds) 755 throws com.liferay.portal.kernel.exception.PortalException, 756 com.liferay.portal.kernel.exception.SystemException; 757 758 /** 759 * Returns all the roles of the subtype. 760 * 761 * @param subtype the role's subtype (optionally <code>null</code>) 762 * @return the roles of the subtype 763 * @throws SystemException if a system exception occurred 764 */ 765 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 766 public java.util.List<com.liferay.portal.model.Role> getSubtypeRoles( 767 java.lang.String subtype) 768 throws com.liferay.portal.kernel.exception.SystemException; 769 770 /** 771 * Returns the number of roles of the subtype. 772 * 773 * @param subtype the role's subtype (optionally <code>null</code>) 774 * @return the number of roles of the subtype 775 * @throws SystemException if a system exception occurred 776 */ 777 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 778 public int getSubtypeRolesCount(java.lang.String subtype) 779 throws com.liferay.portal.kernel.exception.SystemException; 780 781 /** 782 * Returns the team role in the company. 783 * 784 * @param companyId the primary key of the company 785 * @param teamId the primary key of the team 786 * @return the team role in the company 787 * @throws PortalException if a role could not be found in the team and 788 company 789 * @throws SystemException if a system exception occurred 790 */ 791 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 792 public com.liferay.portal.model.Role getTeamRole(long companyId, long teamId) 793 throws com.liferay.portal.kernel.exception.PortalException, 794 com.liferay.portal.kernel.exception.SystemException; 795 796 /** 797 * Returns all the roles of the type. 798 * 799 * @param type the role's type (optionally <code>0</code>) 800 * @return the range of the roles of the type 801 * @throws SystemException if a system exception occurred 802 */ 803 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 804 public java.util.List<com.liferay.portal.model.Role> getTypeRoles(int type) 805 throws com.liferay.portal.kernel.exception.SystemException; 806 807 /** 808 * Returns a range of all the roles of the type. 809 * 810 * @param type the role's type (optionally <code>0</code>) 811 * @param start the lower bound of the range of roles to return 812 * @param end the upper bound of the range of roles to return (not 813 inclusive) 814 * @return the range of the roles of the type 815 * @throws SystemException if a system exception occurred 816 */ 817 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 818 public java.util.List<com.liferay.portal.model.Role> getTypeRoles( 819 int type, int start, int end) 820 throws com.liferay.portal.kernel.exception.SystemException; 821 822 /** 823 * Returns the number of roles of the type. 824 * 825 * @param type the role's type (optionally <code>0</code>) 826 * @return the number of roles of the type 827 * @throws SystemException if a system exception occurred 828 */ 829 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 830 public int getTypeRolesCount(int type) 831 throws com.liferay.portal.kernel.exception.SystemException; 832 833 /** 834 * Returns all the user's roles within the user group. 835 * 836 * @param userId the primary key of the user 837 * @param groupId the primary key of the group 838 * @return the user's roles within the user group 839 * @throws SystemException if a system exception occurred 840 * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupGroupRole( 841 long, long) 842 */ 843 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 844 public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles( 845 long userId, long groupId) 846 throws com.liferay.portal.kernel.exception.SystemException; 847 848 /** 849 * Returns all the user's roles within the user group. 850 * 851 * @param userId the primary key of the user 852 * @param groupId the primary key of the group 853 * @return the user's roles within the user group 854 * @throws SystemException if a system exception occurred 855 * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupRole( 856 long, long) 857 */ 858 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 859 public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles( 860 long userId, long groupId) 861 throws com.liferay.portal.kernel.exception.SystemException; 862 863 /** 864 * Returns the union of all the user's roles within the groups. 865 * 866 * @param userId the primary key of the user 867 * @param groups the groups (optionally <code>null</code>) 868 * @return the union of all the user's roles within the groups 869 * @throws SystemException if a system exception occurred 870 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 871 long, List) 872 */ 873 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 874 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 875 long userId, java.util.List<com.liferay.portal.model.Group> groups) 876 throws com.liferay.portal.kernel.exception.SystemException; 877 878 /** 879 * Returns all the user's roles within the group. 880 * 881 * @param userId the primary key of the user 882 * @param groupId the primary key of the group 883 * @return the user's roles within the group 884 * @throws SystemException if a system exception occurred 885 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 886 long, long) 887 */ 888 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 889 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 890 long userId, long groupId) 891 throws com.liferay.portal.kernel.exception.SystemException; 892 893 /** 894 * Returns the union of all the user's roles within the groups. 895 * 896 * @param userId the primary key of the user 897 * @param groupIds the primary keys of the groups 898 * @return the union of all the user's roles within the groups 899 * @throws SystemException if a system exception occurred 900 * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G( 901 long, long[]) 902 */ 903 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 904 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 905 long userId, long[] groupIds) 906 throws com.liferay.portal.kernel.exception.SystemException; 907 908 /** 909 * Returns <code>true</code> if the user is associated with the named 910 * regular role. 911 * 912 * @param userId the primary key of the user 913 * @param companyId the primary key of the company 914 * @param name the name of the role 915 * @param inherited whether to include the user's inherited roles in the 916 search 917 * @return <code>true</code> if the user is associated with the regular 918 role; <code>false</code> otherwise 919 * @throws PortalException if a default user for the company could not be 920 found 921 * @throws SystemException if a system exception occurred 922 */ 923 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 924 public boolean hasUserRole(long userId, long companyId, 925 java.lang.String name, boolean inherited) 926 throws com.liferay.portal.kernel.exception.PortalException, 927 com.liferay.portal.kernel.exception.SystemException; 928 929 /** 930 * Returns <code>true</code> if the user has any one of the named regular 931 * roles. 932 * 933 * @param userId the primary key of the user 934 * @param companyId the primary key of the company 935 * @param names the names of the roles 936 * @param inherited whether to include the user's inherited roles in the 937 search 938 * @return <code>true</code> if the user has any one of the regular roles; 939 <code>false</code> otherwise 940 * @throws PortalException if any one of the roles with the names could not 941 be found in the company or if the default user for the company 942 could not be found 943 * @throws SystemException if a system exception occurred 944 */ 945 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 946 public boolean hasUserRoles(long userId, long companyId, 947 java.lang.String[] names, boolean inherited) 948 throws com.liferay.portal.kernel.exception.PortalException, 949 com.liferay.portal.kernel.exception.SystemException; 950 951 /** 952 * Returns a role with the name in the company. 953 * 954 * @param companyId the primary key of the company 955 * @param name the role's name (optionally <code>null</code>) 956 * @return the role with the name, or <code>null</code> if a role with the 957 name could not be found in the company 958 * @throws SystemException if a system exception occurred 959 */ 960 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 961 public com.liferay.portal.model.Role loadFetchRole(long companyId, 962 java.lang.String name) 963 throws com.liferay.portal.kernel.exception.SystemException; 964 965 /** 966 * Returns a role with the name in the company. 967 * 968 * @param companyId the primary key of the company 969 * @param name the role's name 970 * @return the role with the name in the company 971 * @throws PortalException if a role with the name could not be found in the 972 company 973 * @throws SystemException if a system exception occurred 974 */ 975 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 976 public com.liferay.portal.model.Role loadGetRole(long companyId, 977 java.lang.String name) 978 throws com.liferay.portal.kernel.exception.PortalException, 979 com.liferay.portal.kernel.exception.SystemException; 980 981 /** 982 * Returns an ordered range of all the roles that match the keywords and 983 * types. 984 * 985 * <p> 986 * Useful when paginating results. Returns a maximum of <code>end - 987 * start</code> instances. <code>start</code> and <code>end</code> are not 988 * primary keys, they are indexes in the result set. Thus, <code>0</code> 989 * refers to the first result in the set. Setting both <code>start</code> 990 * and <code>end</code> to {@link 991 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 992 * result set. 993 * </p> 994 * 995 * @param companyId the primary key of the company 996 * @param keywords the keywords (space separated), which may occur in the 997 role's name or description (optionally <code>null</code>) 998 * @param types the role types (optionally <code>null</code>) 999 * @param start the lower bound of the range of roles to return 1000 * @param end the upper bound of the range of roles to return (not 1001 inclusive) 1002 * @param obc the comparator to order the roles (optionally 1003 <code>null</code>) 1004 * @return the ordered range of the matching roles, ordered by 1005 <code>obc</code> 1006 * @throws SystemException if a system exception occurred 1007 * @see com.liferay.portal.service.persistence.RoleFinder 1008 */ 1009 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1010 public java.util.List<com.liferay.portal.model.Role> search( 1011 long companyId, java.lang.String keywords, java.lang.Integer[] types, 1012 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 1013 throws com.liferay.portal.kernel.exception.SystemException; 1014 1015 /** 1016 * Returns an ordered range of all the roles that match the keywords, types, 1017 * and params. 1018 * 1019 * <p> 1020 * Useful when paginating results. Returns a maximum of <code>end - 1021 * start</code> instances. <code>start</code> and <code>end</code> are not 1022 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1023 * refers to the first result in the set. Setting both <code>start</code> 1024 * and <code>end</code> to {@link 1025 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1026 * result set. 1027 * </p> 1028 * 1029 * @param companyId the primary key of the company 1030 * @param keywords the keywords (space separated), which may occur in the 1031 role's name or description (optionally <code>null</code>) 1032 * @param types the role types (optionally <code>null</code>) 1033 * @param params the finder parameters. Can specify values for the 1034 "usersRoles" key. For more information, see {@link 1035 com.liferay.portal.service.persistence.RoleFinder} 1036 * @param start the lower bound of the range of roles to return 1037 * @param end the upper bound of the range of roles to return (not 1038 inclusive) 1039 * @param obc the comparator to order the roles (optionally 1040 <code>null</code>) 1041 * @return the ordered range of the matching roles, ordered by 1042 <code>obc</code> 1043 * @throws SystemException if a system exception occurred 1044 * @see com.liferay.portal.service.persistence.RoleFinder 1045 */ 1046 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1047 public java.util.List<com.liferay.portal.model.Role> search( 1048 long companyId, java.lang.String keywords, java.lang.Integer[] types, 1049 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1050 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 1051 throws com.liferay.portal.kernel.exception.SystemException; 1052 1053 /** 1054 * Returns an ordered range of all the roles that match the name, 1055 * description, and types. 1056 * 1057 * <p> 1058 * Useful when paginating results. Returns a maximum of <code>end - 1059 * start</code> instances. <code>start</code> and <code>end</code> are not 1060 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1061 * refers to the first result in the set. Setting both <code>start</code> 1062 * and <code>end</code> to {@link 1063 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1064 * result set. 1065 * </p> 1066 * 1067 * @param companyId the primary key of the company 1068 * @param name the role's name (optionally <code>null</code>) 1069 * @param description the role's description (optionally <code>null</code>) 1070 * @param types the role types (optionally <code>null</code>) 1071 * @param start the lower bound of the range of the roles to return 1072 * @param end the upper bound of the range of the roles to return (not 1073 inclusive) 1074 * @param obc the comparator to order the roles (optionally 1075 <code>null</code>) 1076 * @return the ordered range of the matching roles, ordered by 1077 <code>obc</code> 1078 * @throws SystemException if a system exception occurred 1079 * @see com.liferay.portal.service.persistence.RoleFinder 1080 */ 1081 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1082 public java.util.List<com.liferay.portal.model.Role> search( 1083 long companyId, java.lang.String name, java.lang.String description, 1084 java.lang.Integer[] types, int start, int end, 1085 com.liferay.portal.kernel.util.OrderByComparator obc) 1086 throws com.liferay.portal.kernel.exception.SystemException; 1087 1088 /** 1089 * Returns an ordered range of all the roles that match the name, 1090 * description, types, and params. 1091 * 1092 * <p> 1093 * Useful when paginating results. Returns a maximum of <code>end - 1094 * start</code> instances. <code>start</code> and <code>end</code> are not 1095 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1096 * refers to the first result in the set. Setting both <code>start</code> 1097 * and <code>end</code> to {@link 1098 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 1099 * result set. 1100 * </p> 1101 * 1102 * @param companyId the primary key of the company 1103 * @param name the role's name (optionally <code>null</code>) 1104 * @param description the role's description (optionally <code>null</code>) 1105 * @param types the role types (optionally <code>null</code>) 1106 * @param params the finder's parameters. Can specify values for the 1107 "usersRoles" key. For more information, see {@link 1108 com.liferay.portal.service.persistence.RoleFinder} 1109 * @param start the lower bound of the range of the roles to return 1110 * @param end the upper bound of the range of the roles to return (not 1111 inclusive) 1112 * @param obc the comparator to order the roles (optionally 1113 <code>null</code>) 1114 * @return the ordered range of the matching roles, ordered by 1115 <code>obc</code> 1116 * @throws SystemException if a system exception occurred 1117 * @see com.liferay.portal.service.persistence.RoleFinder 1118 */ 1119 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1120 public java.util.List<com.liferay.portal.model.Role> search( 1121 long companyId, java.lang.String name, java.lang.String description, 1122 java.lang.Integer[] types, 1123 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 1124 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 1125 throws com.liferay.portal.kernel.exception.SystemException; 1126 1127 /** 1128 * Returns the number of roles that match the keywords and types. 1129 * 1130 * @param companyId the primary key of the company 1131 * @param keywords the keywords (space separated), which may occur in the 1132 role's name or description (optionally <code>null</code>) 1133 * @param types the role types (optionally <code>null</code>) 1134 * @return the number of matching roles 1135 * @throws SystemException if a system exception occurred 1136 */ 1137 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1138 public int searchCount(long companyId, java.lang.String keywords, 1139 java.lang.Integer[] types) 1140 throws com.liferay.portal.kernel.exception.SystemException; 1141 1142 /** 1143 * Returns the number of roles that match the keywords, types and params. 1144 * 1145 * @param companyId the primary key of the company 1146 * @param keywords the keywords (space separated), which may occur in the 1147 role's name or description (optionally <code>null</code>) 1148 * @param types the role types (optionally <code>null</code>) 1149 * @param params the finder parameters. For more information, see {@link 1150 com.liferay.portal.service.persistence.RoleFinder} 1151 * @return the number of matching roles 1152 * @throws SystemException if a system exception occurred 1153 */ 1154 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1155 public int searchCount(long companyId, java.lang.String keywords, 1156 java.lang.Integer[] types, 1157 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 1158 throws com.liferay.portal.kernel.exception.SystemException; 1159 1160 /** 1161 * Returns the number of roles that match the name, description, and types. 1162 * 1163 * @param companyId the primary key of the company 1164 * @param name the role's name (optionally <code>null</code>) 1165 * @param description the role's description (optionally <code>null</code>) 1166 * @param types the role types (optionally <code>null</code>) 1167 * @return the number of matching roles 1168 * @throws SystemException if a system exception occurred 1169 */ 1170 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1171 public int searchCount(long companyId, java.lang.String name, 1172 java.lang.String description, java.lang.Integer[] types) 1173 throws com.liferay.portal.kernel.exception.SystemException; 1174 1175 /** 1176 * Returns the number of roles that match the name, description, types, and 1177 * params. 1178 * 1179 * @param companyId the primary key of the company 1180 * @param name the role's name (optionally <code>null</code>) 1181 * @param description the role's description (optionally <code>null</code>) 1182 * @param types the role types (optionally <code>null</code>) 1183 * @param params the finder parameters. Can specify values for the 1184 "usersRoles" key. For more information, see {@link 1185 com.liferay.portal.service.persistence.RoleFinder} 1186 * @return the number of matching roles 1187 * @throws SystemException if a system exception occurred 1188 */ 1189 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1190 public int searchCount(long companyId, java.lang.String name, 1191 java.lang.String description, java.lang.Integer[] types, 1192 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 1193 throws com.liferay.portal.kernel.exception.SystemException; 1194 1195 /** 1196 * Removes the matching roles associated with the user. The user is 1197 * reindexed after the roles are removed. 1198 * 1199 * @param userId the primary key of the user 1200 * @param roleIds the primary keys of the roles 1201 * @throws PortalException if a user with the primary key could not be found 1202 or if a role with any one of the primary keys could not be found 1203 * @throws SystemException if a system exception occurred 1204 */ 1205 public void unsetUserRoles(long userId, long[] roleIds) 1206 throws com.liferay.portal.kernel.exception.PortalException, 1207 com.liferay.portal.kernel.exception.SystemException; 1208 1209 /** 1210 * Updates the role with the primary key. 1211 * 1212 * @param roleId the primary key of the role 1213 * @param name the role's new name 1214 * @param titleMap the new localized titles (optionally <code>null</code>) 1215 to replace those existing for the role 1216 * @param descriptionMap the new localized descriptions (optionally 1217 <code>null</code>) to replace those existing for the role 1218 * @param subtype the role's new subtype (optionally <code>null</code>) 1219 * @param serviceContext the service context to be applied (optionally 1220 <code>null</code>). Can set expando bridge attributes for the 1221 role. 1222 * @return the role with the primary key 1223 * @throws PortalException if a role with the primary could not be found or 1224 if the role's name was invalid 1225 * @throws SystemException if a system exception occurred 1226 */ 1227 public com.liferay.portal.model.Role updateRole(long roleId, 1228 java.lang.String name, 1229 java.util.Map<java.util.Locale, java.lang.String> titleMap, 1230 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 1231 java.lang.String subtype, 1232 com.liferay.portal.service.ServiceContext serviceContext) 1233 throws com.liferay.portal.kernel.exception.PortalException, 1234 com.liferay.portal.kernel.exception.SystemException; 1235 }