1 package org.apache.archiva.redback.rest.services;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import net.sf.ehcache.CacheManager;
23 import org.apache.archiva.redback.authentication.AuthenticationException;
24 import org.apache.archiva.redback.authentication.TokenBasedAuthenticationDataSource;
25 import org.apache.archiva.redback.components.cache.Cache;
26 import org.apache.archiva.redback.configuration.UserConfiguration;
27 import org.apache.archiva.redback.configuration.UserConfigurationKeys;
28 import org.apache.archiva.redback.integration.filter.authentication.HttpAuthenticator;
29 import org.apache.archiva.redback.integration.mail.Mailer;
30 import org.apache.archiva.redback.integration.security.role.RedbackRoleConstants;
31 import org.apache.archiva.redback.keys.AuthenticationKey;
32 import org.apache.archiva.redback.keys.KeyManager;
33 import org.apache.archiva.redback.keys.KeyManagerException;
34 import org.apache.archiva.redback.keys.KeyNotFoundException;
35 import org.apache.archiva.redback.policy.AccountLockedException;
36 import org.apache.archiva.redback.policy.MustChangePasswordException;
37 import org.apache.archiva.redback.policy.PasswordEncoder;
38 import org.apache.archiva.redback.policy.UserSecurityPolicy;
39 import org.apache.archiva.redback.rbac.RBACManager;
40 import org.apache.archiva.redback.rbac.RbacManagerException;
41 import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
42 import org.apache.archiva.redback.rbac.UserAssignment;
43 import org.apache.archiva.redback.rest.api.model.ErrorMessage;
44 import org.apache.archiva.redback.rest.api.model.Operation;
45 import org.apache.archiva.redback.rest.api.model.Permission;
46 import org.apache.archiva.redback.rest.api.model.RegistrationKey;
47 import org.apache.archiva.redback.rest.api.model.ResetPasswordRequest;
48 import org.apache.archiva.redback.rest.api.model.Resource;
49 import org.apache.archiva.redback.rest.api.model.User;
50 import org.apache.archiva.redback.rest.api.model.UserRegistrationRequest;
51 import org.apache.archiva.redback.rest.api.services.RedbackServiceException;
52 import org.apache.archiva.redback.rest.api.services.UserService;
53 import org.apache.archiva.redback.rest.services.utils.PasswordValidator;
54 import org.apache.archiva.redback.role.RoleManager;
55 import org.apache.archiva.redback.role.RoleManagerException;
56 import org.apache.archiva.redback.system.SecuritySystem;
57 import org.apache.archiva.redback.users.UserManager;
58 import org.apache.archiva.redback.users.UserNotFoundException;
59 import org.apache.commons.lang.StringUtils;
60 import org.slf4j.Logger;
61 import org.slf4j.LoggerFactory;
62 import org.springframework.stereotype.Service;
64 import javax.inject.Inject;
65 import javax.inject.Named;
66 import javax.mail.internet.AddressException;
67 import javax.mail.internet.InternetAddress;
68 import javax.servlet.http.HttpServletRequest;
69 import javax.ws.rs.core.Context;
70 import javax.ws.rs.core.Response;
71 import java.util.ArrayList;
72 import java.util.Arrays;
73 import java.util.Collection;
74 import java.util.List;
77 @Service( "userService#rest" )
78 public class DefaultUserService
79 implements UserService
82 private Logger log = LoggerFactory.getLogger( getClass() );
84 private static final String VALID_USERNAME_CHARS = "[a-zA-Z_0-9\\-.@]*";
86 private UserManager userManager;
88 private SecuritySystem securitySystem;
91 @Named( value = "userConfiguration" )
92 private UserConfiguration config;
95 private RoleManager roleManager;
98 * cache used for user assignments
101 @Named( value = "cache#userAssignments" )
102 private Cache userAssignmentsCache;
105 * cache used for user permissions
108 @Named( value = "cache#userPermissions" )
109 private Cache userPermissionsCache;
112 * Cache used for users
115 @Named( value = "cache#users" )
116 private Cache usersCache;
119 private Mailer mailer;
122 @Named( value = "rBACManager#cached" )
123 private RBACManager rbacManager;
125 private HttpAuthenticator httpAuthenticator;
128 private PasswordValidator passwordValidator;
131 private HttpServletRequest httpServletRequest;
134 public DefaultUserService( @Named( value = "userManager#cached" ) UserManager userManager,
135 SecuritySystem securitySystem,
136 @Named( "httpAuthenticator#basic" ) HttpAuthenticator httpAuthenticator )
138 this.userManager = userManager;
139 this.securitySystem = securitySystem;
140 this.httpAuthenticator = httpAuthenticator;
144 public Boolean createUser( User user )
145 throws RedbackServiceException
150 org.apache.archiva.redback.users.User u = userManager.findUser( user.getUsername() );
153 throw new RedbackServiceException(
154 new ErrorMessage( "user " + user.getUsername() + " already exists" ) );
157 catch ( UserNotFoundException e )
159 //ignore we just want to prevent non human readable error message from backend :-)
160 log.debug( "user {} not exists", user.getUsername() );
164 if ( StringUtils.isEmpty( user.getUsername() ) )
166 throw new RedbackServiceException( new ErrorMessage( "username cannot be empty" ) );
169 if ( StringUtils.isEmpty( user.getFullName() ) )
171 throw new RedbackServiceException( new ErrorMessage( "fullName cannot be empty" ) );
174 if ( StringUtils.isEmpty( user.getEmail() ) )
176 throw new RedbackServiceException( new ErrorMessage( "email cannot be empty" ) );
179 org.apache.archiva.redback.users.User u =
180 userManager.createUser( user.getUsername(), user.getFullName(), user.getEmail() );
181 u.setPassword( user.getPassword() );
182 u.setLocked( user.isLocked() );
183 u.setPasswordChangeRequired( user.isPasswordChangeRequired() );
184 u.setPermanent( user.isPermanent() );
185 u.setValidated( user.isValidated() );
186 u = userManager.addUser( u );
187 if ( !user.isPasswordChangeRequired() )
189 u.setPasswordChangeRequired( false );
192 u = userManager.updateUser( u );
193 log.debug( "user {} created", u.getUsername() );
195 catch ( UserNotFoundException e )
197 throw new RedbackServiceException( e.getMessage() );
202 roleManager.assignRole( RedbackRoleConstants.REGISTERED_USER_ROLE_ID, u.getUsername() );
204 catch ( RoleManagerException rpe )
206 log.error( "RoleProfile Error: " + rpe.getMessage(), rpe );
207 throw new RedbackServiceException( new ErrorMessage( "assign.role.failure", null ) );
212 public Boolean deleteUser( String username )
213 throws RedbackServiceException
219 if ( rbacManager.userAssignmentExists( username ) )
221 UserAssignment assignment = rbacManager.getUserAssignment( username );
222 rbacManager.removeUserAssignment( assignment );
226 catch ( RbacManagerException e )
228 log.error( e.getMessage(), e );
229 throw new RedbackServiceException( e.getMessage() );
233 userManager.deleteUser( username );
236 catch ( UserNotFoundException e )
238 log.error( e.getMessage(), e );
239 throw new RedbackServiceException( e.getMessage() );
243 removeFromCache( username );
248 public User getUser( String username )
249 throws RedbackServiceException
253 org.apache.archiva.redback.users.User user = userManager.findUser( username );
254 return getSimpleUser( user );
256 catch ( UserNotFoundException e )
262 public List<User> getUsers()
263 throws RedbackServiceException
265 List<org.apache.archiva.redback.users.User> users = userManager.getUsers();
266 List<User> simpleUsers = new ArrayList<User>( users.size() );
268 for ( org.apache.archiva.redback.users.User user : users )
270 simpleUsers.add( getSimpleUser( user ) );
276 public Boolean updateMe( User user )
277 throws RedbackServiceException
279 // check username == one in the session
280 RedbackRequestInformation redbackRequestInformation = RedbackAuthenticationThreadLocal.get();
281 if ( redbackRequestInformation == null || redbackRequestInformation.getUser() == null )
283 throw new RedbackServiceException( new ErrorMessage( "you must be logged to update your profile" ),
284 Response.Status.FORBIDDEN.getStatusCode() );
288 throw new RedbackServiceException( new ErrorMessage( "user parameter is mandatory" ),
289 Response.Status.BAD_REQUEST.getStatusCode() );
291 if ( !StringUtils.equals( redbackRequestInformation.getUser().getUsername(), user.getUsername() ) )
293 throw new RedbackServiceException( new ErrorMessage( "you can update only your profile" ),
294 Response.Status.FORBIDDEN.getStatusCode() );
297 if ( StringUtils.isEmpty( user.getPreviousPassword() ) )
299 throw new RedbackServiceException( new ErrorMessage( "previous password is empty" ),
300 Response.Status.BAD_REQUEST.getStatusCode() );
303 User realUser = getUser( user.getUsername() );
306 String previousEncodedPassword =
307 securitySystem.getUserManager().findUser( user.getUsername() ).getEncodedPassword();
309 // check oldPassword with the current one
311 PasswordEncoder encoder = securitySystem.getPolicy().getPasswordEncoder();
313 if ( !encoder.isPasswordValid( previousEncodedPassword, user.getPreviousPassword() ) )
316 throw new RedbackServiceException( new ErrorMessage( "password.provided.does.not.match.existing" ),
317 Response.Status.BAD_REQUEST.getStatusCode() );
320 catch ( UserNotFoundException e )
322 throw new RedbackServiceException( new ErrorMessage( "user not found" ),
323 Response.Status.BAD_REQUEST.getStatusCode() );
325 // only 3 fields to update
326 realUser.setFullName( user.getFullName() );
327 realUser.setEmail( user.getEmail() );
328 // ui can limit to not update password
329 if ( StringUtils.isNotBlank( user.getPassword() ) )
331 passwordValidator.validatePassword( user.getPassword(), user.getUsername() );
333 realUser.setPassword( user.getPassword() );
336 updateUser( realUser );
341 public Boolean updateUser( User user )
342 throws RedbackServiceException
346 org.apache.archiva.redback.users.User rawUser = userManager.findUser( user.getUsername() );
347 rawUser.setFullName( user.getFullName() );
348 rawUser.setEmail( user.getEmail() );
349 rawUser.setValidated( user.isValidated() );
350 rawUser.setLocked( user.isLocked() );
351 rawUser.setPassword( user.getPassword() );
352 rawUser.setPasswordChangeRequired( user.isPasswordChangeRequired() );
353 rawUser.setPermanent( user.isPermanent() );
355 userManager.updateUser( rawUser );
358 catch ( UserNotFoundException e )
360 throw new RedbackServiceException( e.getMessage() );
364 public int removeFromCache( String userName )
365 throws RedbackServiceException
367 if ( userAssignmentsCache != null )
369 userAssignmentsCache.remove( userName );
371 if ( userPermissionsCache != null )
373 userPermissionsCache.remove( userName );
375 if ( usersCache != null )
377 usersCache.remove( userName );
380 CacheManager cacheManager = CacheManager.getInstance();
381 String[] caches = cacheManager.getCacheNames();
382 for ( String cacheName : caches )
384 if ( StringUtils.startsWith( cacheName, "org.apache.archiva.redback.rbac.jdo" ) )
386 cacheManager.getCache( cacheName ).removeAll();
393 public User getGuestUser()
394 throws RedbackServiceException
398 org.apache.archiva.redback.users.User user = userManager.getGuestUser();
399 return getSimpleUser( user );
401 catch ( Exception e )
407 public User createGuestUser()
408 throws RedbackServiceException
410 User u = getGuestUser();
415 // temporary disable policy during guest creation as no password !
418 securitySystem.getPolicy().setEnabled( false );
419 org.apache.archiva.redback.users.User user = userManager.createGuestUser();
420 user.setPasswordChangeRequired( false );
421 user = userManager.updateUser( user, false );
422 roleManager.assignRole( "guest", user.getUsername() );
423 return getSimpleUser( user );
425 catch ( RoleManagerException e )
427 log.error( e.getMessage(), e );
428 throw new RedbackServiceException( e.getMessage() );
430 catch ( UserNotFoundException e )
432 // olamy I wonder how this can happen :-)
433 log.error( e.getMessage(), e );
434 throw new RedbackServiceException( e.getMessage() );
439 if ( !securitySystem.getPolicy().isEnabled() )
441 securitySystem.getPolicy().setEnabled( true );
446 public Boolean ping()
447 throws RedbackServiceException
452 private User getSimpleUser( org.apache.archiva.redback.users.User user )
458 return new User( user );
461 public Boolean createAdminUser( User adminUser )
462 throws RedbackServiceException
464 if ( isAdminUserExists() )
466 return Boolean.FALSE;
469 org.apache.archiva.redback.users.User user =
470 userManager.createUser( RedbackRoleConstants.ADMINISTRATOR_ACCOUNT_NAME, adminUser.getFullName(),
471 adminUser.getEmail() );
472 user.setPassword( adminUser.getPassword() );
474 user.setLocked( false );
475 user.setPasswordChangeRequired( false );
476 user.setPermanent( true );
477 user.setValidated( true );
479 userManager.addUser( user );
483 roleManager.assignRole( "system-administrator", user.getUsername() );
485 catch ( RoleManagerException e )
487 throw new RedbackServiceException( e.getMessage() );
492 public Boolean isAdminUserExists()
493 throws RedbackServiceException
497 userManager.findUser( config.getString( UserConfigurationKeys.DEFAULT_ADMIN ) );
500 catch ( UserNotFoundException e )
504 return Boolean.FALSE;
507 public Boolean resetPassword( ResetPasswordRequest resetPasswordRequest )
508 throws RedbackServiceException
510 String username = resetPasswordRequest.getUsername();
511 if ( StringUtils.isEmpty( username ) )
513 throw new RedbackServiceException( new ErrorMessage( "username.cannot.be.empty" ) );
516 UserManager userManager = securitySystem.getUserManager();
517 KeyManager keyManager = securitySystem.getKeyManager();
518 UserSecurityPolicy policy = securitySystem.getPolicy();
522 org.apache.archiva.redback.users.User user = userManager.findUser( username );
524 AuthenticationKey authkey = keyManager.createKey( username, "Password Reset Request",
525 policy.getUserValidationSettings().getEmailValidationTimeout() );
527 String applicationUrl = resetPasswordRequest.getApplicationUrl();
528 if ( StringUtils.isBlank( applicationUrl ) )
530 applicationUrl = getBaseUrl();
533 mailer.sendPasswordResetEmail( Arrays.asList( user.getEmail() ), authkey, applicationUrl );
534 log.info( "password reset request for username {}", username );
536 catch ( UserNotFoundException e )
538 log.info( "Password Reset on non-existant user [{}].", username );
539 throw new RedbackServiceException( new ErrorMessage( "password.reset.failure" ) );
541 catch ( KeyManagerException e )
543 log.info( "Unable to issue password reset.", e );
544 throw new RedbackServiceException( new ErrorMessage( "password.reset.email.generation.failure" ) );
550 public RegistrationKey registerUser( UserRegistrationRequest userRegistrationRequest )
551 throws RedbackServiceException
553 User user = userRegistrationRequest.getUser();
556 throw new RedbackServiceException( new ErrorMessage( "invalid.user.credentials", null ) );
560 UserSecurityPolicy securityPolicy = securitySystem.getPolicy();
562 boolean emailValidationRequired = securityPolicy.getUserValidationSettings().isEmailValidationRequired();
564 if ( emailValidationRequired )
566 validateCredentialsLoose( user );
570 validateCredentialsStrict( user );
573 // NOTE: Do not perform Password Rules Validation Here.
575 if ( userManager.userExists( user.getUsername() ) )
577 throw new RedbackServiceException(
578 new ErrorMessage( "user.already.exists", new String[]{ user.getUsername() } ) );
581 org.apache.archiva.redback.users.User u =
582 userManager.createUser( user.getUsername(), user.getFullName(), user.getEmail() );
583 u.setPassword( user.getPassword() );
584 u.setValidated( false );
585 u.setLocked( false );
589 roleManager.assignRole( RedbackRoleConstants.REGISTERED_USER_ROLE_ID, u.getUsername() );
591 catch ( RoleManagerException rpe )
593 log.error( "RoleProfile Error: " + rpe.getMessage(), rpe );
594 throw new RedbackServiceException( new ErrorMessage( "assign.role.failure", null ) );
597 if ( emailValidationRequired )
603 AuthenticationKey authkey =
604 securitySystem.getKeyManager().createKey( u.getUsername(), "New User Email Validation",
605 securityPolicy.getUserValidationSettings().getEmailValidationTimeout() );
607 String baseUrl = userRegistrationRequest.getApplicationUrl();
608 if ( StringUtils.isBlank( baseUrl ) )
610 baseUrl = getBaseUrl();
613 log.debug( "register user {} with email {} and app url {}", u.getUsername(), u.getEmail(), baseUrl );
615 mailer.sendAccountValidationEmail( Arrays.asList( u.getEmail() ), authkey, baseUrl );
617 securityPolicy.setEnabled( false );
618 userManager.addUser( u );
619 return new RegistrationKey( authkey.getKey() );
622 catch ( KeyManagerException e )
624 log.error( "Unable to register a new user.", e );
625 throw new RedbackServiceException( new ErrorMessage( "cannot.register.user", null ) );
629 securityPolicy.setEnabled( true );
634 userManager.addUser( u );
635 return new RegistrationKey( "-1" );
638 // FIXME log this event
640 AuditEvent event = new AuditEvent( getText( "log.account.create" ) );
641 event.setAffectedUser( username );
647 public Boolean validateUserFromKey( String key )
648 throws RedbackServiceException
650 String principal = null;
653 AuthenticationKey authkey = securitySystem.getKeyManager().findKey( key );
655 org.apache.archiva.redback.users.User user =
656 securitySystem.getUserManager().findUser( authkey.getForPrincipal() );
658 user.setValidated( true );
659 user.setLocked( false );
660 user.setPasswordChangeRequired( true );
661 user.setEncodedPassword( "" );
663 principal = user.getUsername();
665 TokenBasedAuthenticationDataSource authsource = new TokenBasedAuthenticationDataSource();
666 authsource.setPrincipal( principal );
667 authsource.setToken( authkey.getKey() );
668 authsource.setEnforcePasswordChange( false );
670 securitySystem.getUserManager().updateUser( user );
672 httpAuthenticator.authenticate( authsource, httpServletRequest.getSession( true ) );
674 log.info( "account validated for user {}", user.getUsername() );
678 catch ( MustChangePasswordException e )
680 throw new RedbackServiceException( e.getMessage(), Response.Status.FORBIDDEN.getStatusCode() );
682 catch ( KeyNotFoundException e )
684 log.info( "Invalid key requested: {}", key );
685 throw new RedbackServiceException( new ErrorMessage( "cannot.find.key" ) );
687 catch ( KeyManagerException e )
689 throw new RedbackServiceException( new ErrorMessage( "cannot.find.key.at.the.momment" ) );
692 catch ( UserNotFoundException e )
694 throw new RedbackServiceException( new ErrorMessage( "cannot.find.user", new String[]{ principal } ) );
697 catch ( AccountLockedException e )
699 throw new RedbackServiceException( e.getMessage(), Response.Status.FORBIDDEN.getStatusCode() );
701 catch ( AuthenticationException e )
703 throw new RedbackServiceException( e.getMessage(), Response.Status.FORBIDDEN.getStatusCode() );
707 public Collection<Permission> getCurrentUserPermissions()
708 throws RedbackServiceException
710 RedbackRequestInformation redbackRequestInformation = RedbackAuthenticationThreadLocal.get();
711 String userName = UserManager.GUEST_USERNAME;
712 if ( redbackRequestInformation != null && redbackRequestInformation.getUser() != null )
714 userName = redbackRequestInformation.getUser().getUsername();
717 return getUserPermissions( userName );
720 public Collection<Operation> getCurrentUserOperations()
721 throws RedbackServiceException
723 RedbackRequestInformation redbackRequestInformation = RedbackAuthenticationThreadLocal.get();
724 String userName = UserManager.GUEST_USERNAME;
725 if ( redbackRequestInformation != null && redbackRequestInformation.getUser() != null )
727 userName = redbackRequestInformation.getUser().getUsername();
730 return getUserOperations( userName );
733 public Collection<Operation> getUserOperations( String userName )
734 throws RedbackServiceException
736 Collection<Permission> permissions = getUserPermissions( userName );
737 List<Operation> operations = new ArrayList<Operation>( permissions.size() );
738 for ( Permission permission : permissions )
740 if ( permission.getOperation() != null )
742 Operation operation = new Operation();
743 operation.setName( permission.getOperation().getName() );
744 operations.add( operation );
750 public Collection<Permission> getUserPermissions( String userName )
751 throws RedbackServiceException
755 Set<org.apache.archiva.redback.rbac.Permission> permissions =
756 rbacManager.getAssignedPermissions( userName );
757 // FIXME return guest permissions !!
758 List<Permission> userPermissions = new ArrayList<Permission>( permissions.size() );
759 for ( org.apache.archiva.redback.rbac.Permission p : permissions )
761 Permission permission = new Permission();
762 permission.setName( p.getName() );
764 if ( p.getOperation() != null )
766 Operation operation = new Operation();
767 operation.setName( p.getOperation().getName() );
768 permission.setOperation( operation );
771 if ( p.getResource() != null )
773 Resource resource = new Resource();
774 resource.setIdentifier( p.getResource().getIdentifier() );
775 resource.setPattern( p.getResource().isPattern() );
776 permission.setResource( resource );
779 userPermissions.add( permission );
781 return userPermissions;
783 catch ( RbacObjectNotFoundException e )
785 log.error( e.getMessage(), e );
786 throw new RedbackServiceException( e.getMessage() );
788 catch ( RbacManagerException e )
790 log.error( e.getMessage(), e );
791 throw new RedbackServiceException( e.getMessage() );
795 public void validateCredentialsLoose( User user )
796 throws RedbackServiceException
798 RedbackServiceException redbackServiceException =
799 new RedbackServiceException( "issues during validating user" );
800 if ( StringUtils.isEmpty( user.getUsername() ) )
802 redbackServiceException.addErrorMessage( new ErrorMessage( "username.required", null ) );
806 if ( !user.getUsername().matches( VALID_USERNAME_CHARS ) )
808 redbackServiceException.addErrorMessage( new ErrorMessage( "username.invalid.characters", null ) );
812 if ( StringUtils.isEmpty( user.getFullName() ) )
814 redbackServiceException.addErrorMessage( new ErrorMessage( "fullName.required", null ) );
817 if ( StringUtils.isEmpty( user.getEmail() ) )
819 redbackServiceException.addErrorMessage( new ErrorMessage( "email.required", null ) );
822 if ( !StringUtils.equals( user.getPassword(), user.getConfirmPassword() ) )
824 redbackServiceException.addErrorMessage( new ErrorMessage( "passwords.does.not.match", null ) );
829 if ( !org.codehaus.plexus.util.StringUtils.isEmpty( user.getEmail() ) )
831 new InternetAddress( user.getEmail(), true );
834 catch ( AddressException e )
836 redbackServiceException.addErrorMessage( new ErrorMessage( "email.invalid", null ) );
838 if ( !redbackServiceException.getErrorMessages().isEmpty() )
840 throw redbackServiceException;
844 public void validateCredentialsStrict( User user )
845 throws RedbackServiceException
847 validateCredentialsLoose( user );
849 org.apache.archiva.redback.users.User tmpuser =
850 userManager.createUser( user.getUsername(), user.getFullName(), user.getEmail() );
852 user.setPassword( user.getPassword() );
854 securitySystem.getPolicy().validatePassword( tmpuser );
856 if ( ( org.codehaus.plexus.util.StringUtils.isEmpty( user.getPassword() ) ) )
858 throw new RedbackServiceException( new ErrorMessage( "password.required", null ) );
862 private String getBaseUrl()
864 if ( httpServletRequest != null )
866 if ( httpServletRequest != null )
868 return httpServletRequest.getScheme() + "://" + httpServletRequest.getServerName() + (
869 httpServletRequest.getServerPort() == 80
871 : ":" + httpServletRequest.getServerPort() ) + httpServletRequest.getContextPath();
877 public Boolean unlockUser( String username )
878 throws RedbackServiceException
880 User user = getUser( username );
883 user.setLocked( false );
887 return Boolean.FALSE;
890 public Boolean lockUser( String username )
891 throws RedbackServiceException
893 User user = getUser( username );
896 user.setLocked( true );
900 return Boolean.FALSE;
903 public Boolean passwordChangeRequired( String username )
904 throws RedbackServiceException
906 User user = getUser( username );
909 user.setPasswordChangeRequired( true );
913 return Boolean.FALSE;
916 public Boolean passwordChangeNotRequired( String username )
917 throws RedbackServiceException
919 User user = getUser( username );
922 user.setPasswordChangeRequired( false );
926 return Boolean.FALSE;