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 @Override 125 public com.liferay.portal.model.Role fetchRole(long roleId) 126 throws com.liferay.portal.kernel.exception.PortalException { 127 return _roleService.fetchRole(roleId); 128 } 129 130 /** 131 * Returns the Spring bean ID for this bean. 132 * 133 * @return the Spring bean ID for this bean 134 */ 135 @Override 136 public java.lang.String getBeanIdentifier() { 137 return _roleService.getBeanIdentifier(); 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 */ 147 @Override 148 public java.util.List<com.liferay.portal.model.Role> getGroupRoles( 149 long groupId) 150 throws com.liferay.portal.kernel.exception.PortalException { 151 return _roleService.getGroupRoles(groupId); 152 } 153 154 /** 155 * Returns the role with the name in the company. 156 * 157 * <p> 158 * The method searches the system roles map first for default roles. If a 159 * role with the name is not found, then the method will query the database. 160 * </p> 161 * 162 * @param companyId the primary key of the company 163 * @param name the role's name 164 * @return the role with the name 165 * @throws PortalException if a role with the name could not be found in the 166 company or if the user did not have permission to view the role 167 */ 168 @Override 169 public com.liferay.portal.model.Role getRole(long companyId, 170 java.lang.String name) 171 throws com.liferay.portal.kernel.exception.PortalException { 172 return _roleService.getRole(companyId, name); 173 } 174 175 /** 176 * Returns the role with the primary key. 177 * 178 * @param roleId the primary key of the role 179 * @return the role with the primary key 180 * @throws PortalException if a role with the primary key could not be found 181 or if the user did not have permission to view the role 182 */ 183 @Override 184 public com.liferay.portal.model.Role getRole(long roleId) 185 throws com.liferay.portal.kernel.exception.PortalException { 186 return _roleService.getRole(roleId); 187 } 188 189 @Override 190 public java.util.List<com.liferay.portal.model.Role> getRoles( 191 long companyId, int[] types) 192 throws com.liferay.portal.kernel.exception.PortalException { 193 return _roleService.getRoles(companyId, types); 194 } 195 196 @Override 197 public java.util.List<com.liferay.portal.model.Role> getRoles(int type, 198 java.lang.String subtype) 199 throws com.liferay.portal.kernel.exception.PortalException { 200 return _roleService.getRoles(type, subtype); 201 } 202 203 /** 204 * Returns all the user's roles within the user group. 205 * 206 * @param userId the primary key of the user 207 * @param groupId the primary key of the group 208 * @return the user's roles within the user group 209 * @throws PortalException if a portal exception occurred 210 */ 211 @Override 212 public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles( 213 long userId, long groupId) 214 throws com.liferay.portal.kernel.exception.PortalException { 215 return _roleService.getUserGroupGroupRoles(userId, groupId); 216 } 217 218 /** 219 * Returns all the user's roles within the user group. 220 * 221 * @param userId the primary key of the user 222 * @param groupId the primary key of the group 223 * @return the user's roles within the user group 224 * @throws PortalException if a portal exception occurred 225 */ 226 @Override 227 public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles( 228 long userId, long groupId) 229 throws com.liferay.portal.kernel.exception.PortalException { 230 return _roleService.getUserGroupRoles(userId, groupId); 231 } 232 233 /** 234 * Returns the union of all the user's roles within the groups. 235 * 236 * @param userId the primary key of the user 237 * @param groups the groups (optionally <code>null</code>) 238 * @return the union of all the user's roles within the groups 239 * @throws PortalException if a portal exception occurred 240 */ 241 @Override 242 public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles( 243 long userId, java.util.List<com.liferay.portal.model.Group> groups) 244 throws com.liferay.portal.kernel.exception.PortalException { 245 return _roleService.getUserRelatedRoles(userId, groups); 246 } 247 248 /** 249 * Returns all the roles associated with the user. 250 * 251 * @param userId the primary key of the user 252 * @return the roles associated with the user 253 * @throws PortalException if a portal exception occurred 254 */ 255 @Override 256 public java.util.List<com.liferay.portal.model.Role> getUserRoles( 257 long userId) throws com.liferay.portal.kernel.exception.PortalException { 258 return _roleService.getUserRoles(userId); 259 } 260 261 /** 262 * Returns <code>true</code> if the user is associated with the named 263 * regular role. 264 * 265 * @param userId the primary key of the user 266 * @param companyId the primary key of the company 267 * @param name the name of the role 268 * @param inherited whether to include the user's inherited roles in the 269 search 270 * @return <code>true</code> if the user is associated with the regular 271 role; <code>false</code> otherwise 272 * @throws PortalException if a role with the name could not be found in the 273 company or if a default user for the company could not be found 274 */ 275 @Override 276 public boolean hasUserRole(long userId, long companyId, 277 java.lang.String name, boolean inherited) 278 throws com.liferay.portal.kernel.exception.PortalException { 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 */ 297 @Override 298 public boolean hasUserRoles(long userId, long companyId, 299 java.lang.String[] names, boolean inherited) 300 throws com.liferay.portal.kernel.exception.PortalException { 301 return _roleService.hasUserRoles(userId, companyId, names, inherited); 302 } 303 304 @Override 305 public java.util.List<com.liferay.portal.model.Role> search( 306 long companyId, java.lang.String keywords, java.lang.Integer[] types, 307 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params, 308 int start, int end, 309 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Role> obc) { 310 return _roleService.search(companyId, keywords, types, params, start, 311 end, obc); 312 } 313 314 @Override 315 public int searchCount(long companyId, java.lang.String keywords, 316 java.lang.Integer[] types, 317 java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) { 318 return _roleService.searchCount(companyId, keywords, types, params); 319 } 320 321 /** 322 * Sets the Spring bean ID for this bean. 323 * 324 * @param beanIdentifier the Spring bean ID for this bean 325 */ 326 @Override 327 public void setBeanIdentifier(java.lang.String beanIdentifier) { 328 _roleService.setBeanIdentifier(beanIdentifier); 329 } 330 331 /** 332 * Removes the matching roles associated with the user. The user is 333 * reindexed after the roles are removed. 334 * 335 * @param userId the primary key of the user 336 * @param roleIds the primary keys of the roles 337 * @throws PortalException if a user with the primary key could not be 338 found, if the user did not have permission to remove members from 339 a role, or if a role with any one of the primary keys could not 340 be found 341 */ 342 @Override 343 public void unsetUserRoles(long userId, long[] roleIds) 344 throws com.liferay.portal.kernel.exception.PortalException { 345 _roleService.unsetUserRoles(userId, roleIds); 346 } 347 348 /** 349 * Updates the role with the primary key. 350 * 351 * @param roleId the primary key of the role 352 * @param name the role's new name 353 * @param titleMap the new localized titles (optionally <code>null</code>) 354 to replace those existing for the role 355 * @param descriptionMap the new localized descriptions (optionally 356 <code>null</code>) to replace those existing for the role 357 * @param subtype the role's new subtype (optionally <code>null</code>) 358 * @param serviceContext the service context to be applied (optionally 359 <code>null</code>). Can set the expando bridge attributes for the 360 role. 361 * @return the role with the primary key 362 * @throws PortalException if the user did not have permission to update the 363 role, if a role with the primary could not be found, or if the 364 role's name was invalid 365 */ 366 @Override 367 public com.liferay.portal.model.Role updateRole(long roleId, 368 java.lang.String name, 369 java.util.Map<java.util.Locale, java.lang.String> titleMap, 370 java.util.Map<java.util.Locale, java.lang.String> descriptionMap, 371 java.lang.String subtype, 372 com.liferay.portal.service.ServiceContext serviceContext) 373 throws com.liferay.portal.kernel.exception.PortalException { 374 return _roleService.updateRole(roleId, name, titleMap, descriptionMap, 375 subtype, serviceContext); 376 } 377 378 /** 379 * @deprecated As of 6.1.0, replaced by {@link #getWrappedService} 380 */ 381 @Deprecated 382 public RoleService getWrappedRoleService() { 383 return _roleService; 384 } 385 386 /** 387 * @deprecated As of 6.1.0, replaced by {@link #setWrappedService} 388 */ 389 @Deprecated 390 public void setWrappedRoleService(RoleService roleService) { 391 _roleService = roleService; 392 } 393 394 @Override 395 public RoleService getWrappedService() { 396 return _roleService; 397 } 398 399 @Override 400 public void setWrappedService(RoleService roleService) { 401 _roleService = roleService; 402 } 403 404 private RoleService _roleService; 405 }