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