001 /** 002 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portal.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 /** 020 * Provides a wrapper for {@link RoleService}. 021 * 022 * @author Brian Wing Shun Chan 023 * @see RoleService 024 * @generated 025 */ 026 @ProviderType 027 public class RoleServiceWrapper implements RoleService, 028 ServiceWrapper<RoleService> { 029 public RoleServiceWrapper(RoleService roleService) { 030 _roleService = roleService; 031 } 032 033 /** 034 * Returns the Spring bean ID for this bean. 035 * 036 * @return the Spring bean ID for this bean 037 */ 038 @Override 039 public java.lang.String getBeanIdentifier() { 040 return _roleService.getBeanIdentifier(); 041 } 042 043 /** 044 * Sets the Spring bean ID for this bean. 045 * 046 * @param beanIdentifier the Spring bean ID for this bean 047 */ 048 @Override 049 public void setBeanIdentifier(java.lang.String beanIdentifier) { 050 _roleService.setBeanIdentifier(beanIdentifier); 051 } 052 053 /** 054 * Adds a role. The user is reindexed after role is added. 055 * 056 * @param className the name of the class for which the role is created 057 * @param classPK the primary key of the class for which the role is 058 created (optionally <code>0</code>) 059 * @param name the role's name 060 * @param titleMap the role's localized titles (optionally 061 <code>null</code>) 062 * @param descriptionMap the role's localized descriptions (optionally 063 <code>null</code>) 064 * @param type the role's type (optionally <code>0</code>) 065 * @param subtype the role's subtype (optionally <code>null</code>) 066 * @param serviceContext the service context to be applied (optionally 067 <code>null</code>). Can set the expando bridge attributes for the 068 role. 069 * @return the role 070 * @throws PortalException if a user with the primary key could not be 071 found, if the user did not have permission to add roles, if the 072 class name or the role name were invalid, or if the role is a 073 duplicate 074 * @throws SystemException if a system exception occurred 075 */ 076 @Override 077 public com.liferay.portal.model.Role addRole(java.lang.String className, 078 long classPK, java.lang.String name, 079 java.util.Map<java.util.Locale, java.lang.String> titleMap, 080 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 081 int type, java.lang.String subtype, 082 com.liferay.portal.service.ServiceContext serviceContext) 083 throws com.liferay.portal.kernel.exception.PortalException, 084 com.liferay.portal.kernel.exception.SystemException { 085 return _roleService.addRole(className, classPK, name, titleMap, 086 descriptionMap, type, subtype, serviceContext); 087 } 088 089 /** 090 * Adds a role. The user is reindexed after role is added. 091 * 092 * @param name the role's name 093 * @param titleMap the role's localized titles (optionally 094 <code>null</code>) 095 * @param descriptionMap the role's localized descriptions (optionally 096 <code>null</code>) 097 * @param type the role's type (optionally <code>0</code>) 098 * @return the role 099 * @throws PortalException if a user with the primary key could not be 100 found, if the user did not have permission to add roles, if 101 the class name or the role name were invalid, or if the role 102 is a duplicate 103 * @throws SystemException if a system exception occurred 104 * @deprecated As of 6.2.0, replaced by {@link #addRole(String, long, 105 String, Map, Map, int, String, ServiceContext)} 106 */ 107 @Override 108 public com.liferay.portal.model.Role addRole(java.lang.String name, 109 java.util.Map<java.util.Locale, java.lang.String> titleMap, 110 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 111 int type) 112 throws com.liferay.portal.kernel.exception.PortalException, 113 com.liferay.portal.kernel.exception.SystemException { 114 return _roleService.addRole(name, titleMap, descriptionMap, type); 115 } 116 117 /** 118 * Adds the roles to the user. The user is reindexed after the roles are 119 * added. 120 * 121 * @param userId the primary key of the user 122 * @param roleIds the primary keys of the roles 123 * @throws PortalException if a user with the primary key could not be found 124 or if the user did not have permission to assign members to one 125 of the roles 126 * @throws SystemException if a system exception occurred 127 */ 128 @Override 129 public void addUserRoles(long userId, long[] roleIds) 130 throws com.liferay.portal.kernel.exception.PortalException, 131 com.liferay.portal.kernel.exception.SystemException { 132 _roleService.addUserRoles(userId, roleIds); 133 } 134 135 /** 136 * Deletes the role with the primary key and its associated permissions. 137 * 138 * @param roleId the primary key of the role 139 * @throws PortalException if the user did not have permission to delete the 140 role, if a role with the primary key could not be found, if the 141 role is a default system role, or if the role's resource could 142 not be found 143 * @throws SystemException if a system exception occurred 144 */ 145 @Override 146 public void deleteRole(long roleId) 147 throws com.liferay.portal.kernel.exception.PortalException, 148 com.liferay.portal.kernel.exception.SystemException { 149 _roleService.deleteRole(roleId); 150 } 151 152 /** 153 * Returns all the roles associated with the group. 154 * 155 * @param groupId the primary key of the group 156 * @return the roles associated with the group 157 * @throws PortalException if a portal exception occurred 158 * @throws SystemException if a system exception occurred 159 */ 160 @Override 161 public java.util.List<com.liferay.portal.model.Role> getGroupRoles( 162 long groupId) 163 throws com.liferay.portal.kernel.exception.PortalException, 164 com.liferay.portal.kernel.exception.SystemException { 165 return _roleService.getGroupRoles(groupId); 166 } 167 168 @Override 169 public java.util.List<com.liferay.portal.model.Role> getGroupRolesAndTeamRoles( 170 long companyId, java.lang.String keywords, 171 java.util.List<java.lang.String> excludedNames, int[] types, 172 long excludedTeamRoleId, long teamGroupId, int start, int end) 173 throws com.liferay.portal.kernel.exception.SystemException { 174 return _roleService.getGroupRolesAndTeamRoles(companyId, keywords, 175 excludedNames, types, excludedTeamRoleId, teamGroupId, start, end); 176 } 177 178 @Override 179 public int getGroupRolesAndTeamRolesCount(long companyId, 180 java.lang.String keywords, 181 java.util.List<java.lang.String> excludedNames, int[] types, 182 long excludedTeamRoleId, long teamGroupId) 183 throws com.liferay.portal.kernel.exception.SystemException { 184 return _roleService.getGroupRolesAndTeamRolesCount(companyId, keywords, 185 excludedNames, types, excludedTeamRoleId, teamGroupId); 186 } 187 188 /** 189 * Returns the role with the primary key. 190 * 191 * @param roleId the primary key of the role 192 * @return the role with the primary key 193 * @throws PortalException if a role with the primary key could not be found 194 or if the user did not have permission to view the role 195 * @throws SystemException if a system exception occurred 196 */ 197 @Override 198 public com.liferay.portal.model.Role getRole(long roleId) 199 throws com.liferay.portal.kernel.exception.PortalException, 200 com.liferay.portal.kernel.exception.SystemException { 201 return _roleService.getRole(roleId); 202 } 203 204 /** 205 * Returns the role with the name in the company. 206 * 207 * <p> 208 * The method searches the system roles map first for default roles. If a 209 * role with the name is not found, then the method will query the database. 210 * </p> 211 * 212 * @param companyId the primary key of the company 213 * @param name the role's name 214 * @return the role with the name 215 * @throws PortalException if a role with the name could not be found in the 216 company or if the user did not have permission to view the role 217 * @throws SystemException if a system exception occurred 218 */ 219 @Override 220 public com.liferay.portal.model.Role getRole(long companyId, 221 java.lang.String name) 222 throws com.liferay.portal.kernel.exception.PortalException, 223 com.liferay.portal.kernel.exception.SystemException { 224 return _roleService.getRole(companyId, name); 225 } 226 227 /** 228 * Returns all the user's roles within the user group. 229 * 230 * @param userId the primary key of the user 231 * @param groupId the primary key of the group 232 * @return the user's roles within the user group 233 * @throws PortalException if a portal exception occurred 234 * @throws SystemException if a system exception occurred 235 */ 236 @Override 237 public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles( 238 long userId, long groupId) 239 throws com.liferay.portal.kernel.exception.PortalException, 240 com.liferay.portal.kernel.exception.SystemException { 241 return _roleService.getUserGroupGroupRoles(userId, groupId); 242 } 243 244 /** 245 * Returns all the user's roles within the user group. 246 * 247 * @param userId the primary key of the user 248 * @param groupId the primary key of the group 249 * @return the user's roles within the user group 250 * @throws PortalException if a portal exception occurred 251 * @throws SystemException if a system exception occurred 252 */ 253 @Override 254 public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles( 255 long userId, long groupId) 256 throws com.liferay.portal.kernel.exception.PortalException, 257 com.liferay.portal.kernel.exception.SystemException { 258 return _roleService.getUserGroupRoles(userId, groupId); 259 } 260 261 /** 262 * Returns the union of all the user's roles within the groups. 263 * 264 * @param userId the primary key of the user 265 * @param groups the groups (optionally <code>null</code>) 266 * @return the union of all the user's roles within the groups 267 * @throws PortalException if a portal exception occurred 268 * @throws SystemException if a system exception occurred 269 */ 270 @Override 271 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 272 long userId, java.util.List<com.liferay.portal.model.Group> groups) 273 throws com.liferay.portal.kernel.exception.PortalException, 274 com.liferay.portal.kernel.exception.SystemException { 275 return _roleService.getUserRelatedRoles(userId, groups); 276 } 277 278 /** 279 * Returns all the roles associated with the user. 280 * 281 * @param userId the primary key of the user 282 * @return the roles associated with the user 283 * @throws PortalException if a portal exception occurred 284 * @throws SystemException if a system exception occurred 285 */ 286 @Override 287 public java.util.List<com.liferay.portal.model.Role> getUserRoles( 288 long userId) 289 throws com.liferay.portal.kernel.exception.PortalException, 290 com.liferay.portal.kernel.exception.SystemException { 291 return _roleService.getUserRoles(userId); 292 } 293 294 /** 295 * Returns <code>true</code> if the user is associated with the named 296 * regular role. 297 * 298 * @param userId the primary key of the user 299 * @param companyId the primary key of the company 300 * @param name the name of the role 301 * @param inherited whether to include the user's inherited roles in the 302 search 303 * @return <code>true</code> if the user is associated with the regular 304 role; <code>false</code> otherwise 305 * @throws PortalException if a role with the name could not be found in the 306 company or if a default user for the company could not be found 307 * @throws SystemException if a system exception occurred 308 */ 309 @Override 310 public boolean hasUserRole(long userId, long companyId, 311 java.lang.String name, boolean inherited) 312 throws com.liferay.portal.kernel.exception.PortalException, 313 com.liferay.portal.kernel.exception.SystemException { 314 return _roleService.hasUserRole(userId, companyId, name, inherited); 315 } 316 317 /** 318 * Returns <code>true</code> if the user has any one of the named regular 319 * roles. 320 * 321 * @param userId the primary key of the user 322 * @param companyId the primary key of the company 323 * @param names the names of the roles 324 * @param inherited whether to include the user's inherited roles in the 325 search 326 * @return <code>true</code> if the user has any one of the regular roles; 327 <code>false</code> otherwise 328 * @throws PortalException if any one of the roles with the names could not 329 be found in the company or if the default user for the company 330 could not be found 331 * @throws SystemException if a system exception occurred 332 */ 333 @Override 334 public boolean hasUserRoles(long userId, long companyId, 335 java.lang.String[] names, boolean inherited) 336 throws com.liferay.portal.kernel.exception.PortalException, 337 com.liferay.portal.kernel.exception.SystemException { 338 return _roleService.hasUserRoles(userId, companyId, names, inherited); 339 } 340 341 @Override 342 public java.util.List<com.liferay.portal.model.Role> search( 343 long companyId, java.lang.String keywords, java.lang.Integer[] types, 344 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 345 int start, int end, 346 com.liferay.portal.kernel.util.OrderByComparator obc) 347 throws com.liferay.portal.kernel.exception.SystemException { 348 return _roleService.search(companyId, keywords, types, params, start, 349 end, obc); 350 } 351 352 @Override 353 public int searchCount(long companyId, java.lang.String keywords, 354 java.lang.Integer[] types, 355 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) 356 throws com.liferay.portal.kernel.exception.SystemException { 357 return _roleService.searchCount(companyId, keywords, types, params); 358 } 359 360 /** 361 * Removes the matching roles associated with the user. The user is 362 * reindexed after the roles are removed. 363 * 364 * @param userId the primary key of the user 365 * @param roleIds the primary keys of the roles 366 * @throws PortalException if a user with the primary key could not be 367 found, if the user did not have permission to remove members from 368 a role, or if a role with any one of the primary keys could not 369 be found 370 * @throws SystemException if a system exception occurred 371 */ 372 @Override 373 public void unsetUserRoles(long userId, long[] roleIds) 374 throws com.liferay.portal.kernel.exception.PortalException, 375 com.liferay.portal.kernel.exception.SystemException { 376 _roleService.unsetUserRoles(userId, roleIds); 377 } 378 379 /** 380 * Updates the role with the primary key. 381 * 382 * @param roleId the primary key of the role 383 * @param name the role's new name 384 * @param titleMap the new localized titles (optionally <code>null</code>) 385 to replace those existing for the role 386 * @param descriptionMap the new localized descriptions (optionally 387 <code>null</code>) to replace those existing for the role 388 * @param subtype the role's new subtype (optionally <code>null</code>) 389 * @param serviceContext the service context to be applied (optionally 390 <code>null</code>). Can set the expando bridge attributes for the 391 role. 392 * @return the role with the primary key 393 * @throws PortalException if the user did not have permission to update the 394 role, if a role with the primary could not be found, or if the 395 role's name was invalid 396 * @throws SystemException if a system exception occurred 397 */ 398 @Override 399 public com.liferay.portal.model.Role updateRole(long roleId, 400 java.lang.String name, 401 java.util.Map<java.util.Locale, java.lang.String> titleMap, 402 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 403 java.lang.String subtype, 404 com.liferay.portal.service.ServiceContext serviceContext) 405 throws com.liferay.portal.kernel.exception.PortalException, 406 com.liferay.portal.kernel.exception.SystemException { 407 return _roleService.updateRole(roleId, name, titleMap, descriptionMap, 408 subtype, serviceContext); 409 } 410 411 /** 412 * @deprecated As of 6.1.0, replaced by {@link #getWrappedService} 413 */ 414 public RoleService getWrappedRoleService() { 415 return _roleService; 416 } 417 418 /** 419 * @deprecated As of 6.1.0, replaced by {@link #setWrappedService} 420 */ 421 public void setWrappedRoleService(RoleService roleService) { 422 _roleService = roleService; 423 } 424 425 @Override 426 public RoleService getWrappedService() { 427 return _roleService; 428 } 429 430 @Override 431 public void setWrappedService(RoleService roleService) { 432 _roleService = roleService; 433 } 434 435 private RoleService _roleService; 436 }