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