1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package info.magnolia.cms.security;
35
36 import info.magnolia.cms.security.auth.ACL;
37 import info.magnolia.cms.security.auth.GroupList;
38 import info.magnolia.cms.security.auth.RoleList;
39 import info.magnolia.context.MgnlContext;
40
41 import java.util.Collection;
42 import java.util.Map;
43
44 import javax.jcr.Value;
45 import javax.security.auth.Subject;
46
47
48
49
50
51
52 public class ExternalUserManager implements UserManager {
53
54 @Override
55 public User getUser(String name) throws UnsupportedOperationException {
56
57
58 if (name.equalsIgnoreCase(MgnlContext.getUser().getName())) {
59 return MgnlContext.getUser();
60 }
61 throw new UnsupportedOperationException("not implemented yet");
62 }
63
64 @Override
65 public User getUserById(final String id) throws UnsupportedOperationException {
66 throw new UnsupportedOperationException("not implemented yet");
67 }
68
69
70
71
72
73
74 @Override
75 public User getUser(Subject subject) throws UnsupportedOperationException {
76 return new ExternalUser(subject);
77 }
78
79 public User getUser(Map<String, String> properties, GroupList groupList, RoleList roleList){
80 return new ExternalUser(properties, groupList, roleList);
81 }
82
83 @Override
84 public Collection<User> getAllUsers() throws UnsupportedOperationException {
85 throw new UnsupportedOperationException("not implemented yet");
86 }
87
88 @Override
89 public User createUser(String name, String pw) throws UnsupportedOperationException {
90 throw new UnsupportedOperationException("not implemented yet");
91 }
92
93 @Override
94 public User changePassword(User user, String newPassword) throws UnsupportedOperationException {
95 throw new UnsupportedOperationException("not implemented yet");
96 }
97
98
99
100
101 @Override
102 public User getSystemUser() throws UnsupportedOperationException {
103 throw new UnsupportedOperationException();
104 }
105
106
107
108
109 @Override
110 public User getAnonymousUser() throws UnsupportedOperationException {
111 throw new UnsupportedOperationException();
112 }
113
114 @Override
115 public void updateLastAccessTimestamp(User user) throws UnsupportedOperationException {
116 throw new UnsupportedOperationException();
117 }
118
119 @Override
120 public boolean hasAny(String name, String roleName, String nodeRoles) throws UnsupportedOperationException {
121 throw new UnsupportedOperationException("not implemented yet");
122 }
123
124 @Override
125 public Map<String,ACL> getACLs(User user) {
126 throw new UnsupportedOperationException("not implemented yet");
127 }
128
129 @Override
130 public User addRole(User user, String roleName) {
131 throw new UnsupportedOperationException("not implemented yet");
132 }
133
134 @Override
135 public User addGroup(User user, String groupName) {
136 throw new UnsupportedOperationException("not implemented yet");
137 }
138
139 @Override
140 public int getLockTimePeriod() {
141 throw new UnsupportedOperationException("Not supported by this user manager.");
142 }
143
144 @Override
145 public int getMaxFailedLoginAttempts() {
146 throw new UnsupportedOperationException("Not supported by this user manager.");
147 }
148
149 @Override
150 public void setLockTimePeriod(int lockTimePeriod){
151 throw new UnsupportedOperationException("Not supported by this user manager.");
152 }
153
154 @Override
155 public void setMaxFailedLoginAttempts(int maxFailedLoginAttempts){
156 throw new UnsupportedOperationException("Not supported by this user manager.");
157 }
158
159 @Override
160 public User setProperty(User user, String propertyName, Value propertyValue) {
161 throw new UnsupportedOperationException("Not supported by this user manager.");
162 }
163
164 @Override
165 public User removeGroup(User user, String groupName) {
166 throw new UnsupportedOperationException("not implemented yet");
167 }
168
169 @Override
170 public User removeRole(User user, String roleName) {
171 throw new UnsupportedOperationException("not implemented yet");
172 }
173 }