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