Improvet doc
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.core / src / main / java / org / argeo / security / jcr / JcrUserDetails.java
index f7d016cf40cbd1983400c83adbd301e344a3d81e..11e463d349a7a7f86cf30d953e0636ef342ea8db 100644 (file)
@@ -7,6 +7,7 @@ import org.springframework.security.GrantedAuthority;
 import org.springframework.security.GrantedAuthorityImpl;
 import org.springframework.security.userdetails.User;
 
+/** User details wrapping a home node. */
 public class JcrUserDetails extends User {
        private static final long serialVersionUID = -3594542993773402380L;
        private final String homePath;
@@ -20,10 +21,7 @@ public class JcrUserDetails extends User {
                this.homePath = homePath;
        }
 
-       public String getHomePath() {
-               return homePath;
-       }
-
+       /** Clone immutable with new roles */
        public JcrUserDetails cloneWithNewRoles(List<String> roles) {
                List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
                for (String role : roles) {
@@ -35,9 +33,15 @@ public class JcrUserDetails extends User {
                                authorities.toArray(new GrantedAuthority[authorities.size()]));
        }
 
+       /** Clone immutable with new password */
        public JcrUserDetails cloneWithNewPassword(String password) {
                return new JcrUserDetails(homePath, getUsername(), password,
                                isEnabled(), isAccountNonExpired(), isAccountNonExpired(),
                                isAccountNonLocked(), getAuthorities());
        }
+
+       public String getHomePath() {
+               return homePath;
+       }
+
 }