Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUserFactory.java @ 157:6e6965873a48
Simplified creation of users.
artifacts/trunk@1382 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 03 Mar 2011 10:33:49 +0000 |
parents | 1a72f08ce8d7 |
children | 4748949c4f19 |
comparison
equal
deleted
inserted
replaced
156:a76de72ad6d1 | 157:6e6965873a48 |
---|---|
49 * @param name The name for the new user. | 49 * @param name The name for the new user. |
50 * @param role The role for the new user. | 50 * @param role The role for the new user. |
51 * @param context The CallContext. | 51 * @param context The CallContext. |
52 */ | 52 */ |
53 public User createUser( | 53 public User createUser( |
54 String identifier, | |
54 String name, | 55 String name, |
55 Document role, | 56 Document role, |
56 Object context) | 57 Object context) |
57 { | 58 { |
58 logger.debug("DefaultUserFactory.createUser: " + name); | 59 logger.debug("DefaultUserFactory.createUser: " + name); |
59 | 60 return new DefaultUser(identifier, name, role); |
60 return Backend.getInstance().createUser(name, role); | |
61 } | |
62 | |
63 | |
64 /** | |
65 * Deletes the given user. | |
66 * | |
67 * @param user The user to be deleted. | |
68 * @param context The CallContext. | |
69 */ | |
70 public boolean deleteUser(String identifier, Object context) { | |
71 logger.debug("DefaultUserFactory.deleteUser: " + identifier); | |
72 | |
73 return Backend.getInstance().deleteUser(identifier); | |
74 } | |
75 | |
76 | |
77 /** | |
78 * Returns the user with the given identifier. | |
79 * | |
80 * @param identifier The identifier of a user. | |
81 * @param context The CallContext. | |
82 * | |
83 * @return the user with the given identifier. | |
84 */ | |
85 public User getUser(String identifier, Object context) { | |
86 logger.debug("DefaultUserFactory.getUser: " + identifier); | |
87 | |
88 return Backend.getInstance().getUser(identifier); | |
89 } | |
90 | |
91 | |
92 /** | |
93 * Returns a list of users available for this application. | |
94 * | |
95 * @param context The CallContext. | |
96 * | |
97 * @return a list of users. | |
98 */ | |
99 public User [] getUsers(Object context) { | |
100 logger.debug("DefaultUserFactory.getUsers"); | |
101 | |
102 return Backend.getInstance().getUsers(); | |
103 } | 61 } |
104 } | 62 } |
105 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 63 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |