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