001 /** 002 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service; 016 017 import 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 /** 169 * Returns the role with the primary key. 170 * 171 * @param roleId the primary key of the role 172 * @return the role with the primary key 173 * @throws PortalException if a role with the primary key could not be found 174 or if the user did not have permission to view the role 175 * @throws SystemException if a system exception occurred 176 */ 177 @Override 178 public com.liferay.portal.model.Role getRole(long roleId) 179 throws com.liferay.portal.kernel.exception.PortalException, 180 com.liferay.portal.kernel.exception.SystemException { 181 return _roleService.getRole(roleId); 182 } 183 184 /** 185 * Returns the role with the name in the company. 186 * 187 * <p> 188 * The method searches the system roles map first for default roles. If a 189 * role with the name is not found, then the method will query the database. 190 * </p> 191 * 192 * @param companyId the primary key of the company 193 * @param name the role's name 194 * @return the role with the name 195 * @throws PortalException if a role with the name could not be found in the 196 company or if the user did not have permission to view the role 197 * @throws SystemException if a system exception occurred 198 */ 199 @Override 200 public com.liferay.portal.model.Role getRole(long companyId, 201 java.lang.String name) 202 throws com.liferay.portal.kernel.exception.PortalException, 203 com.liferay.portal.kernel.exception.SystemException { 204 return _roleService.getRole(companyId, name); 205 } 206 207 /** 208 * Returns all the user's roles within the user group. 209 * 210 * @param userId the primary key of the user 211 * @param groupId the primary key of the group 212 * @return the user's roles within the user group 213 * @throws PortalException if a portal exception occurred 214 * @throws SystemException if a system exception occurred 215 */ 216 @Override 217 public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles( 218 long userId, long groupId) 219 throws com.liferay.portal.kernel.exception.PortalException, 220 com.liferay.portal.kernel.exception.SystemException { 221 return _roleService.getUserGroupGroupRoles(userId, groupId); 222 } 223 224 /** 225 * Returns all the user's roles within the user group. 226 * 227 * @param userId the primary key of the user 228 * @param groupId the primary key of the group 229 * @return the user's roles within the user group 230 * @throws PortalException if a portal exception occurred 231 * @throws SystemException if a system exception occurred 232 */ 233 @Override 234 public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles( 235 long userId, long groupId) 236 throws com.liferay.portal.kernel.exception.PortalException, 237 com.liferay.portal.kernel.exception.SystemException { 238 return _roleService.getUserGroupRoles(userId, groupId); 239 } 240 241 /** 242 * Returns the union of all the user's roles within the groups. 243 * 244 * @param userId the primary key of the user 245 * @param groups the groups (optionally <code>null</code>) 246 * @return the union of all the user's roles within the groups 247 * @throws PortalException if a portal exception occurred 248 * @throws SystemException if a system exception occurred 249 */ 250 @Override 251 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 252 long userId, java.util.List<com.liferay.portal.model.Group> groups) 253 throws com.liferay.portal.kernel.exception.PortalException, 254 com.liferay.portal.kernel.exception.SystemException { 255 return _roleService.getUserRelatedRoles(userId, groups); 256 } 257 258 /** 259 * Returns all the roles associated with the user. 260 * 261 * @param userId the primary key of the user 262 * @return the roles associated with the user 263 * @throws PortalException if a portal exception occurred 264 * @throws SystemException if a system exception occurred 265 */ 266 @Override 267 public java.util.List<com.liferay.portal.model.Role> getUserRoles( 268 long userId) 269 throws com.liferay.portal.kernel.exception.PortalException, 270 com.liferay.portal.kernel.exception.SystemException { 271 return _roleService.getUserRoles(userId); 272 } 273 274 /** 275 * Returns <code>true</code> if the user is associated with the named 276 * regular role. 277 * 278 * @param userId the primary key of the user 279 * @param companyId the primary key of the company 280 * @param name the name of the role 281 * @param inherited whether to include the user's inherited roles in the 282 search 283 * @return <code>true</code> if the user is associated with the regular 284 role; <code>false</code> otherwise 285 * @throws PortalException if a role with the name could not be found in the 286 company or if a default user for the company could not be found 287 * @throws SystemException if a system exception occurred 288 */ 289 @Override 290 public boolean hasUserRole(long userId, long companyId, 291 java.lang.String name, boolean inherited) 292 throws com.liferay.portal.kernel.exception.PortalException, 293 com.liferay.portal.kernel.exception.SystemException { 294 return _roleService.hasUserRole(userId, companyId, name, inherited); 295 } 296 297 /** 298 * Returns <code>true</code> if the user has any one of the named regular 299 * roles. 300 * 301 * @param userId the primary key of the user 302 * @param companyId the primary key of the company 303 * @param names the names of the roles 304 * @param inherited whether to include the user's inherited roles in the 305 search 306 * @return <code>true</code> if the user has any one of the regular roles; 307 <code>false</code> otherwise 308 * @throws PortalException if any one of the roles with the names could not 309 be found in the company or if the default user for the company 310 could not be found 311 * @throws SystemException if a system exception occurred 312 */ 313 @Override 314 public boolean hasUserRoles(long userId, long companyId, 315 java.lang.String[] names, boolean inherited) 316 throws com.liferay.portal.kernel.exception.PortalException, 317 com.liferay.portal.kernel.exception.SystemException { 318 return _roleService.hasUserRoles(userId, companyId, names, inherited); 319 } 320 321 /** 322 * Removes the matching roles associated with the user. The user is 323 * reindexed after the roles are removed. 324 * 325 * @param userId the primary key of the user 326 * @param roleIds the primary keys of the roles 327 * @throws PortalException if a user with the primary key could not be 328 found, if the user did not have permission to remove members from 329 a role, or if a role with any one of the primary keys could not 330 be found 331 * @throws SystemException if a system exception occurred 332 */ 333 @Override 334 public void unsetUserRoles(long userId, long[] roleIds) 335 throws com.liferay.portal.kernel.exception.PortalException, 336 com.liferay.portal.kernel.exception.SystemException { 337 _roleService.unsetUserRoles(userId, roleIds); 338 } 339 340 /** 341 * Updates the role with the primary key. 342 * 343 * @param roleId the primary key of the role 344 * @param name the role's new name 345 * @param titleMap the new localized titles (optionally <code>null</code>) 346 to replace those existing for the role 347 * @param descriptionMap the new localized descriptions (optionally 348 <code>null</code>) to replace those existing for the role 349 * @param subtype the role's new subtype (optionally <code>null</code>) 350 * @param serviceContext the service context to be applied (optionally 351 <code>null</code>). Can set the expando bridge attributes for the 352 role. 353 * @return the role with the primary key 354 * @throws PortalException if the user did not have permission to update the 355 role, if a role with the primary could not be found, or if the 356 role's name was invalid 357 * @throws SystemException if a system exception occurred 358 */ 359 @Override 360 public com.liferay.portal.model.Role updateRole(long roleId, 361 java.lang.String name, 362 java.util.Map<java.util.Locale, java.lang.String> titleMap, 363 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 364 java.lang.String subtype, 365 com.liferay.portal.service.ServiceContext serviceContext) 366 throws com.liferay.portal.kernel.exception.PortalException, 367 com.liferay.portal.kernel.exception.SystemException { 368 return _roleService.updateRole(roleId, name, titleMap, descriptionMap, 369 subtype, serviceContext); 370 } 371 372 /** 373 * @deprecated As of 6.1.0, replaced by {@link #getWrappedService} 374 */ 375 public RoleService getWrappedRoleService() { 376 return _roleService; 377 } 378 379 /** 380 * @deprecated As of 6.1.0, replaced by {@link #setWrappedService} 381 */ 382 public void setWrappedRoleService(RoleService roleService) { 383 _roleService = roleService; 384 } 385 386 @Override 387 public RoleService getWrappedService() { 388 return _roleService; 389 } 390 391 @Override 392 public void setWrappedService(RoleService roleService) { 393 _roleService = roleService; 394 } 395 396 private RoleService _roleService; 397 }