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.context.MgnlContext;
38
39 import java.util.Collection;
40 import java.util.Map;
41
42 import javax.jcr.Value;
43 import javax.security.auth.Subject;
44
45
46
47
48
49
50 public class ExternalUserManager implements UserManager {
51
52 @Override
53 public User getUser(String name) throws UnsupportedOperationException {
54
55
56 if (name.equalsIgnoreCase(MgnlContext.getUser().getName())) {
57 return MgnlContext.getUser();
58 }
59 throw new UnsupportedOperationException("not implemented yet");
60 }
61
62
63
64
65
66
67 @Override
68 public User getUser(Subject subject) throws UnsupportedOperationException {
69 return new ExternalUser(subject);
70 }
71
72 @Override
73 public Collection<User> getAllUsers() throws UnsupportedOperationException {
74 throw new UnsupportedOperationException("not implemented yet");
75 }
76
77 @Override
78 public User createUser(String name, String pw) throws UnsupportedOperationException {
79 throw new UnsupportedOperationException("not implemented yet");
80 }
81
82 @Override
83 public User changePassword(User user, String newPassword) throws UnsupportedOperationException {
84 throw new UnsupportedOperationException("not implemented yet");
85 }
86
87
88
89
90 @Override
91 public User getSystemUser() throws UnsupportedOperationException {
92 throw new UnsupportedOperationException();
93 }
94
95
96
97
98 @Override
99 public User getAnonymousUser() throws UnsupportedOperationException {
100 throw new UnsupportedOperationException();
101 }
102
103 @Override
104 public void updateLastAccessTimestamp(User user) throws UnsupportedOperationException {
105 throw new UnsupportedOperationException();
106 }
107
108 @Override
109 public boolean hasAny(String name, String roleName, String nodeRoles) throws UnsupportedOperationException {
110 throw new UnsupportedOperationException("not implemented yet");
111 }
112
113 @Override
114 public Map<String,ACL> getACLs(User user) {
115 throw new UnsupportedOperationException("not implemented yet");
116 }
117
118 @Override
119 public User addRole(User user, String roleName) {
120 throw new UnsupportedOperationException("not implemented yet");
121 }
122
123 @Override
124 public User addGroup(User user, String groupName) {
125 throw new UnsupportedOperationException("not implemented yet");
126 }
127
128 @Override
129 public int getLockTimePeriod() {
130 throw new UnsupportedOperationException("Not supported by this user manager.");
131 }
132
133 @Override
134 public int getMaxFailedLoginAttempts() {
135 throw new UnsupportedOperationException("Not supported by this user manager.");
136 }
137
138 @Override
139 public void setLockTimePeriod(int lockTimePeriod){
140 throw new UnsupportedOperationException("Not supported by this user manager.");
141 }
142
143 @Override
144 public void setMaxFailedLoginAttempts(int maxFailedLoginAttempts){
145 throw new UnsupportedOperationException("Not supported by this user manager.");
146 }
147
148 @Override
149 public User setProperty(User user, String propertyName, Value propertyValue) {
150 throw new UnsupportedOperationException("Not supported by this user manager.");
151 }
152
153 @Override
154 public User removeGroup(User user, String groupName) {
155 throw new UnsupportedOperationException("not implemented yet");
156 }
157
158 @Override
159 public User removeRole(User user, String roleName) {
160 throw new UnsupportedOperationException("not implemented yet");
161 }
162 }