1 package org.apache.archiva.security;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.archiva.admin.model.beans.ManagedRepository;
23
24 import java.util.Collections;
25 import java.util.List;
26
27
28
29
30
31
32 public class UserRepositoriesStub
33 implements UserRepositories
34 {
35 private List<String> repoIds = Collections.singletonList( "test-repo" );
36
37 @Override
38 public void createMissingRepositoryRoles( String repoId )
39 throws ArchivaSecurityException
40 {
41 }
42
43 @Override
44 public List<String> getObservableRepositoryIds( String principal )
45 throws ArchivaSecurityException
46 {
47 return repoIds;
48 }
49
50 public void setObservableRepositoryIds( List<String> repoIds )
51 {
52 this.repoIds = repoIds;
53 }
54
55 @Override
56 public boolean isAuthorizedToUploadArtifacts( String principal, String repoId )
57 throws ArchivaSecurityException
58 {
59 return true;
60 }
61
62 @Override
63 public boolean isAuthorizedToDeleteArtifacts( String principal, String repoId )
64 {
65 return true;
66 }
67
68 @Override
69 public List<String> getManagableRepositoryIds( String principal )
70 throws ArchivaSecurityException
71 {
72 return null;
73 }
74
75 public List<String> getRepoIds()
76 {
77 return repoIds;
78 }
79
80 public void setRepoIds( List<String> repoIds )
81 {
82 this.repoIds = repoIds;
83 }
84
85 @Override
86 public List<ManagedRepository> getAccessibleRepositories( String principal )
87 throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException
88 {
89 return Collections.emptyList();
90 }
91
92 @Override
93 public List<ManagedRepository> getManagableRepositories(String principal) throws ArchivaSecurityException, AccessDeniedException, PrincipalNotFoundException {
94 return Collections.emptyList();
95 }
96 }