1 package org.apache.archiva.consumers.lucene.test;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
21 import org.codehaus.plexus.redback.rbac.Operation;
22 import org.codehaus.plexus.redback.rbac.Permission;
23 import org.codehaus.plexus.redback.rbac.RBACManager;
24 import org.codehaus.plexus.redback.rbac.RBACManagerListener;
25 import org.codehaus.plexus.redback.rbac.RbacManagerException;
26 import org.codehaus.plexus.redback.rbac.RbacObjectInvalidException;
27 import org.codehaus.plexus.redback.rbac.RbacObjectNotFoundException;
28 import org.codehaus.plexus.redback.rbac.Resource;
29 import org.codehaus.plexus.redback.rbac.Role;
30 import org.codehaus.plexus.redback.rbac.UserAssignment;
31 import org.codehaus.plexus.redback.rbac.memory.MemoryResource;
32 import org.springframework.stereotype.Service;
34 import java.util.Collection;
35 import java.util.List;
40 * @author Olivier Lamy
42 @Service("rBACManager#cached")
43 public class TestRBACManager implements RBACManager
45 public void addListener( RBACManagerListener listener )
47 //To change body of implemented methods use File | Settings | File Templates.
50 public void removeListener( RBACManagerListener listener )
52 //To change body of implemented methods use File | Settings | File Templates.
55 public Role createRole( String name )
57 return null; //To change body of implemented methods use File | Settings | File Templates.
60 public boolean roleExists( String name )
62 return false; //To change body of implemented methods use File | Settings | File Templates.
65 public boolean roleExists( Role role )
67 return false; //To change body of implemented methods use File | Settings | File Templates.
70 public Role saveRole( Role role )
71 throws RbacObjectInvalidException, RbacManagerException
73 return null; //To change body of implemented methods use File | Settings | File Templates.
76 public void saveRoles( Collection<Role> roles )
77 throws RbacObjectInvalidException, RbacManagerException
79 //To change body of implemented methods use File | Settings | File Templates.
82 public Role getRole( String roleName )
83 throws RbacObjectNotFoundException, RbacManagerException
85 return null; //To change body of implemented methods use File | Settings | File Templates.
88 public Map<String, Role> getRoles( Collection<String> roleNames )
89 throws RbacObjectNotFoundException, RbacManagerException
91 return null; //To change body of implemented methods use File | Settings | File Templates.
94 public void addChildRole( Role role, Role childRole )
95 throws RbacObjectInvalidException, RbacManagerException
97 //To change body of implemented methods use File | Settings | File Templates.
100 public Map<String, Role> getChildRoles( Role role )
101 throws RbacManagerException
103 return null; //To change body of implemented methods use File | Settings | File Templates.
106 public Map<String, Role> getParentRoles( Role role )
107 throws RbacManagerException
109 return null; //To change body of implemented methods use File | Settings | File Templates.
112 public List<Role> getAllRoles()
113 throws RbacManagerException
115 return null; //To change body of implemented methods use File | Settings | File Templates.
118 public Set<Role> getEffectiveRoles( Role role )
119 throws RbacObjectNotFoundException, RbacManagerException
121 return null; //To change body of implemented methods use File | Settings | File Templates.
124 public void removeRole( Role role )
125 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
127 //To change body of implemented methods use File | Settings | File Templates.
130 public void removeRole( String roleName )
131 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
133 //To change body of implemented methods use File | Settings | File Templates.
136 public Permission createPermission( String name )
137 throws RbacManagerException
139 return null; //To change body of implemented methods use File | Settings | File Templates.
142 public Permission createPermission( String name, String operationName, String resourceIdentifier )
143 throws RbacManagerException
145 return null; //To change body of implemented methods use File | Settings | File Templates.
148 public boolean permissionExists( String name )
150 return false; //To change body of implemented methods use File | Settings | File Templates.
153 public boolean permissionExists( Permission permission )
155 return false; //To change body of implemented methods use File | Settings | File Templates.
158 public Permission savePermission( Permission permission )
159 throws RbacObjectInvalidException, RbacManagerException
161 return null; //To change body of implemented methods use File | Settings | File Templates.
164 public Permission getPermission( String permissionName )
165 throws RbacObjectNotFoundException, RbacManagerException
167 return null; //To change body of implemented methods use File | Settings | File Templates.
170 public List<Permission> getAllPermissions()
171 throws RbacManagerException
173 return null; //To change body of implemented methods use File | Settings | File Templates.
176 public void removePermission( Permission permission )
177 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
179 //To change body of implemented methods use File | Settings | File Templates.
182 public void removePermission( String permissionName )
183 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
185 //To change body of implemented methods use File | Settings | File Templates.
188 public Operation createOperation( String name )
189 throws RbacManagerException
191 return null; //To change body of implemented methods use File | Settings | File Templates.
194 public boolean operationExists( String name )
196 return false; //To change body of implemented methods use File | Settings | File Templates.
199 public boolean operationExists( Operation operation )
204 public Operation saveOperation( Operation operation )
205 throws RbacObjectInvalidException, RbacManagerException
210 public Operation getOperation( String operationName )
211 throws RbacObjectNotFoundException, RbacManagerException
216 public List<Operation> getAllOperations()
217 throws RbacManagerException
222 public void removeOperation( Operation operation )
223 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
227 public void removeOperation( String operationName )
228 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
232 public Resource createResource( String identifier )
233 throws RbacManagerException
235 return new MemoryResource();
238 public boolean resourceExists( String identifier )
240 return false; //To change body of implemented methods use File | Settings | File Templates.
243 public boolean resourceExists( Resource resource )
245 return false; //To change body of implemented methods use File | Settings | File Templates.
248 public Resource saveResource( Resource resource )
249 throws RbacObjectInvalidException, RbacManagerException
251 return null; //To change body of implemented methods use File | Settings | File Templates.
254 public Resource getResource( String resourceIdentifier )
255 throws RbacObjectNotFoundException, RbacManagerException
257 return null; //To change body of implemented methods use File | Settings | File Templates.
260 public List<Resource> getAllResources()
261 throws RbacManagerException
263 return null; //To change body of implemented methods use File | Settings | File Templates.
266 public void removeResource( Resource resource )
267 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
269 //To change body of implemented methods use File | Settings | File Templates.
272 public void removeResource( String resourceIdentifier )
273 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
275 //To change body of implemented methods use File | Settings | File Templates.
278 public UserAssignment createUserAssignment( String principal )
279 throws RbacManagerException
281 return null; //To change body of implemented methods use File | Settings | File Templates.
284 public boolean userAssignmentExists( String principal )
286 return false; //To change body of implemented methods use File | Settings | File Templates.
289 public boolean userAssignmentExists( UserAssignment assignment )
291 return false; //To change body of implemented methods use File | Settings | File Templates.
294 public UserAssignment saveUserAssignment( UserAssignment userAssignment )
295 throws RbacObjectInvalidException, RbacManagerException
297 return null; //To change body of implemented methods use File | Settings | File Templates.
300 public UserAssignment getUserAssignment( String principal )
301 throws RbacObjectNotFoundException, RbacManagerException
303 return null; //To change body of implemented methods use File | Settings | File Templates.
306 public List<UserAssignment> getAllUserAssignments()
307 throws RbacManagerException
309 return null; //To change body of implemented methods use File | Settings | File Templates.
312 public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
313 throws RbacManagerException
315 return null; //To change body of implemented methods use File | Settings | File Templates.
318 public void removeUserAssignment( UserAssignment userAssignment )
319 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
321 //To change body of implemented methods use File | Settings | File Templates.
324 public void removeUserAssignment( String principal )
325 throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
327 //To change body of implemented methods use File | Settings | File Templates.
330 public Collection<Role> getAssignedRoles( String principal )
331 throws RbacObjectNotFoundException, RbacManagerException
333 return null; //To change body of implemented methods use File | Settings | File Templates.
336 public Collection<Role> getAssignedRoles( UserAssignment userAssignment )
337 throws RbacObjectNotFoundException, RbacManagerException
339 return null; //To change body of implemented methods use File | Settings | File Templates.
342 public Collection<Role> getEffectivelyUnassignedRoles( String principal )
343 throws RbacManagerException, RbacObjectNotFoundException
345 return null; //To change body of implemented methods use File | Settings | File Templates.
348 public Collection<Role> getEffectivelyAssignedRoles( String principal )
349 throws RbacObjectNotFoundException, RbacManagerException
351 return null; //To change body of implemented methods use File | Settings | File Templates.
354 public Collection<Role> getUnassignedRoles( String principal )
355 throws RbacManagerException, RbacObjectNotFoundException
357 return null; //To change body of implemented methods use File | Settings | File Templates.
360 public Set<Permission> getAssignedPermissions( String principal )
361 throws RbacObjectNotFoundException, RbacManagerException
363 return null; //To change body of implemented methods use File | Settings | File Templates.
366 public Map<String, List<Permission>> getAssignedPermissionMap( String principal )
367 throws RbacObjectNotFoundException, RbacManagerException
369 return null; //To change body of implemented methods use File | Settings | File Templates.
372 public List<Role> getAllAssignableRoles()
373 throws RbacManagerException, RbacObjectNotFoundException
375 return null; //To change body of implemented methods use File | Settings | File Templates.
378 public Resource getGlobalResource()
379 throws RbacManagerException
381 return null; //To change body of implemented methods use File | Settings | File Templates.
384 public void eraseDatabase()
386 //To change body of implemented methods use File | Settings | File Templates.