1 | |
package org.apache.archiva.web.xmlrpc.security; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
import java.util.List; |
23 | |
|
24 | |
import org.apache.maven.archiva.security.ArchivaSecurityException; |
25 | |
import org.apache.maven.archiva.security.PrincipalNotFoundException; |
26 | |
import org.apache.maven.archiva.security.UserRepositories; |
27 | |
import org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.AuthenticationHandler; |
28 | |
|
29 | |
public class XmlRpcUserRepositories |
30 | |
{ |
31 | |
private UserRepositories userRepositories; |
32 | |
|
33 | |
private AuthenticationHandler authnHandler; |
34 | |
|
35 | |
public XmlRpcUserRepositories( UserRepositories userRepositories, AuthenticationHandler authnHandler ) |
36 | 0 | { |
37 | 0 | this.userRepositories = userRepositories; |
38 | 0 | this.authnHandler = authnHandler; |
39 | 0 | } |
40 | |
|
41 | |
public List<String> getObservableRepositories() |
42 | |
throws PrincipalNotFoundException, ArchivaSecurityException |
43 | |
{ |
44 | 0 | XmlRpcAuthenticator xmlRpcAuthn = (XmlRpcAuthenticator) authnHandler; |
45 | |
|
46 | 0 | return userRepositories.getObservableRepositoryIds( xmlRpcAuthn.getActiveUser() ); |
47 | |
} |
48 | |
} |