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