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