1 package com.atlassian.user.impl;
2
3 import com.atlassian.user.EntityException;
4 import com.atlassian.user.User;
5 import com.atlassian.user.UserManager;
6 import com.atlassian.user.security.password.Credential;
7
8 public abstract class ReadOnlyUserManager implements UserManager
9 {
10 public User createUser(String username) throws EntityException
11 {
12 throw new UnsupportedOperationException("Cannot write to read-only UserManager [" + getIdentifier().getKey() +"]");
13 }
14
15 public User createUser(User user, Credential credential) throws EntityException
16 {
17 throw new UnsupportedOperationException("Cannot write to read-only UserManager [" + getIdentifier().getKey() +"]");
18 }
19
20 public void alterPassword(User user, String plainTextPass) throws EntityException
21 {
22 throw new UnsupportedOperationException("Cannot write to read-only UserManager [" + getIdentifier().getKey() + "]");
23 }
24
25 public void saveUser(User user) throws EntityException
26 {
27 throw new UnsupportedOperationException("Cannot write to read-only UserManager [" + getIdentifier().getKey() + "]");
28 }
29
30 public void removeUser(User user) throws EntityException
31 {
32 throw new UnsupportedOperationException("Cannot write to read-only UserManager [" + getIdentifier().getKey() + "]");
33 }
34
35 public boolean isReadOnly(User user) throws EntityException
36 {
37 return (getUser(user.getName()) != null);
38 }
39
40 public boolean isCreative()
41 {
42 return false;
43 }
44 }