]> git.argeo.org Git - lgpl/argeo-commons.git/blob - security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/SimpleArgeoUser.java
Add license headers
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.core / src / main / java / org / argeo / security / SimpleArgeoUser.java
1 /*
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.argeo.security;
18
19 import java.io.Serializable;
20 import java.util.ArrayList;
21 import java.util.List;
22
23 public class SimpleArgeoUser implements ArgeoUser, Serializable {
24 private static final long serialVersionUID = 1L;
25
26 private String username;
27 private String password;
28 private List<UserNature> userNatures = new ArrayList<UserNature>();
29 private List<String> roles = new ArrayList<String>();
30
31 public SimpleArgeoUser() {
32
33 }
34
35 public SimpleArgeoUser(ArgeoUser argeoUser) {
36 username = argeoUser.getUsername();
37 password = argeoUser.getPassword();
38 userNatures = new ArrayList<UserNature>(argeoUser.getUserNatures());
39 roles = new ArrayList<String>(argeoUser.getRoles());
40 }
41
42 public List<UserNature> getUserNatures() {
43 return userNatures;
44 }
45
46 public void updateUserNatures(List<UserNature> userNaturesData) {
47 UserNature.updateUserNaturesWithCheck(userNatures, userNaturesData);
48 }
49
50 public List<String> getRoles() {
51 return roles;
52 }
53
54 public String getUsername() {
55 return username;
56 }
57
58 public void setUsername(String username) {
59 this.username = username;
60 }
61
62 public void setUserNatures(List<UserNature> userNatures) {
63 this.userNatures = userNatures;
64 }
65
66 public void setRoles(List<String> roles) {
67 this.roles = roles;
68 }
69
70 public String getPassword() {
71 return password;
72 }
73
74 public void setPassword(String password) {
75 this.password = password;
76 }
77 }