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