You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TestRBACManager.java 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. package org.apache.archiva.consumers.lucene.test;
  2. /*
  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
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  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
  18. * under the License.
  19. */
  20. import org.apache.archiva.redback.rbac.Operation;
  21. import org.apache.archiva.redback.rbac.Permission;
  22. import org.apache.archiva.redback.rbac.RBACManager;
  23. import org.apache.archiva.redback.rbac.RBACManagerListener;
  24. import org.apache.archiva.redback.rbac.RbacManagerException;
  25. import org.apache.archiva.redback.rbac.RbacObjectInvalidException;
  26. import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
  27. import org.apache.archiva.redback.rbac.Resource;
  28. import org.apache.archiva.redback.rbac.Role;
  29. import org.apache.archiva.redback.rbac.UserAssignment;
  30. import org.springframework.stereotype.Service;
  31. import java.util.Collection;
  32. import java.util.List;
  33. import java.util.Map;
  34. import java.util.Set;
  35. /**
  36. * @author Olivier Lamy
  37. */
  38. @Service("rbacManager#cached")
  39. public class TestRBACManager implements RBACManager
  40. {
  41. @Override
  42. public void initialize()
  43. {
  44. }
  45. @Override
  46. public boolean isFinalImplementation()
  47. {
  48. return false;
  49. }
  50. @Override
  51. public String getDescriptionKey()
  52. {
  53. return "archiva.redback.rbacmanager.test";
  54. }
  55. @Override
  56. public void addListener( RBACManagerListener listener )
  57. {
  58. }
  59. @Override
  60. public void removeListener( RBACManagerListener listener )
  61. {
  62. }
  63. @Override
  64. public Role createRole( String name )
  65. {
  66. return null;
  67. }
  68. @Override
  69. public boolean roleExists( String name )
  70. {
  71. return false;
  72. }
  73. @Override
  74. public boolean roleExists( Role role )
  75. {
  76. return false;
  77. }
  78. @Override
  79. public Role saveRole( Role role )
  80. throws RbacObjectInvalidException, RbacManagerException
  81. {
  82. return null;
  83. }
  84. @Override
  85. public void saveRoles( Collection<Role> roles )
  86. throws RbacObjectInvalidException, RbacManagerException
  87. {
  88. }
  89. @Override
  90. public Role getRole( String roleName )
  91. throws RbacObjectNotFoundException, RbacManagerException
  92. {
  93. return null;
  94. }
  95. @Override
  96. public Map<String, Role> getRoles( Collection<String> roleNames )
  97. throws RbacObjectNotFoundException, RbacManagerException
  98. {
  99. return null; //To change body of implemented methods use File | Settings | File Templates.
  100. }
  101. @Override
  102. public void addChildRole( Role role, Role childRole )
  103. throws RbacObjectInvalidException, RbacManagerException
  104. {
  105. //To change body of implemented methods use File | Settings | File Templates.
  106. }
  107. @Override
  108. public Map<String, Role> getChildRoles( Role role )
  109. throws RbacManagerException
  110. {
  111. return null; //To change body of implemented methods use File | Settings | File Templates.
  112. }
  113. @Override
  114. public Map<String, Role> getParentRoles( Role role )
  115. throws RbacManagerException
  116. {
  117. return null; //To change body of implemented methods use File | Settings | File Templates.
  118. }
  119. @Override
  120. public List<Role> getAllRoles()
  121. throws RbacManagerException
  122. {
  123. return null; //To change body of implemented methods use File | Settings | File Templates.
  124. }
  125. @Override
  126. public Set<Role> getEffectiveRoles( Role role )
  127. throws RbacObjectNotFoundException, RbacManagerException
  128. {
  129. return null; //To change body of implemented methods use File | Settings | File Templates.
  130. }
  131. @Override
  132. public void removeRole( Role role )
  133. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  134. {
  135. //To change body of implemented methods use File | Settings | File Templates.
  136. }
  137. @Override
  138. public void removeRole( String roleName )
  139. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  140. {
  141. //To change body of implemented methods use File | Settings | File Templates.
  142. }
  143. @Override
  144. public Permission createPermission( String name )
  145. throws RbacManagerException
  146. {
  147. return null; //To change body of implemented methods use File | Settings | File Templates.
  148. }
  149. @Override
  150. public Permission createPermission( String name, String operationName, String resourceIdentifier )
  151. throws RbacManagerException
  152. {
  153. return null; //To change body of implemented methods use File | Settings | File Templates.
  154. }
  155. @Override
  156. public boolean permissionExists( String name )
  157. {
  158. return false; //To change body of implemented methods use File | Settings | File Templates.
  159. }
  160. @Override
  161. public boolean permissionExists( Permission permission )
  162. {
  163. return false; //To change body of implemented methods use File | Settings | File Templates.
  164. }
  165. @Override
  166. public Permission savePermission( Permission permission )
  167. throws RbacObjectInvalidException, RbacManagerException
  168. {
  169. return null; //To change body of implemented methods use File | Settings | File Templates.
  170. }
  171. @Override
  172. public Permission getPermission( String permissionName )
  173. throws RbacObjectNotFoundException, RbacManagerException
  174. {
  175. return null; //To change body of implemented methods use File | Settings | File Templates.
  176. }
  177. @Override
  178. public List<Permission> getAllPermissions()
  179. throws RbacManagerException
  180. {
  181. return null; //To change body of implemented methods use File | Settings | File Templates.
  182. }
  183. @Override
  184. public void removePermission( Permission permission )
  185. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  186. {
  187. //To change body of implemented methods use File | Settings | File Templates.
  188. }
  189. @Override
  190. public void removePermission( String permissionName )
  191. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  192. {
  193. //To change body of implemented methods use File | Settings | File Templates.
  194. }
  195. @Override
  196. public Operation createOperation( String name )
  197. throws RbacManagerException
  198. {
  199. return null; //To change body of implemented methods use File | Settings | File Templates.
  200. }
  201. @Override
  202. public boolean operationExists( String name )
  203. {
  204. return false; //To change body of implemented methods use File | Settings | File Templates.
  205. }
  206. @Override
  207. public boolean operationExists( Operation operation )
  208. {
  209. return false;
  210. }
  211. @Override
  212. public Operation saveOperation( Operation operation )
  213. throws RbacObjectInvalidException, RbacManagerException
  214. {
  215. return null;
  216. }
  217. @Override
  218. public Operation getOperation( String operationName )
  219. throws RbacObjectNotFoundException, RbacManagerException
  220. {
  221. return null;
  222. }
  223. @Override
  224. public List<Operation> getAllOperations()
  225. throws RbacManagerException
  226. {
  227. return null;
  228. }
  229. @Override
  230. public void removeOperation( Operation operation )
  231. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  232. {
  233. }
  234. @Override
  235. public void removeOperation( String operationName )
  236. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  237. {
  238. }
  239. @Override
  240. public Resource createResource( String identifier )
  241. throws RbacManagerException
  242. {
  243. return null;
  244. }
  245. @Override
  246. public boolean resourceExists( String identifier )
  247. {
  248. return false; //To change body of implemented methods use File | Settings | File Templates.
  249. }
  250. @Override
  251. public boolean resourceExists( Resource resource )
  252. {
  253. return false; //To change body of implemented methods use File | Settings | File Templates.
  254. }
  255. @Override
  256. public Resource saveResource( Resource resource )
  257. throws RbacObjectInvalidException, RbacManagerException
  258. {
  259. return null; //To change body of implemented methods use File | Settings | File Templates.
  260. }
  261. @Override
  262. public Resource getResource( String resourceIdentifier )
  263. throws RbacObjectNotFoundException, RbacManagerException
  264. {
  265. return null; //To change body of implemented methods use File | Settings | File Templates.
  266. }
  267. @Override
  268. public List<Resource> getAllResources()
  269. throws RbacManagerException
  270. {
  271. return null; //To change body of implemented methods use File | Settings | File Templates.
  272. }
  273. @Override
  274. public void removeResource( Resource resource )
  275. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  276. {
  277. //To change body of implemented methods use File | Settings | File Templates.
  278. }
  279. @Override
  280. public void removeResource( String resourceIdentifier )
  281. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  282. {
  283. //To change body of implemented methods use File | Settings | File Templates.
  284. }
  285. @Override
  286. public UserAssignment createUserAssignment( String principal )
  287. throws RbacManagerException
  288. {
  289. return null; //To change body of implemented methods use File | Settings | File Templates.
  290. }
  291. @Override
  292. public boolean userAssignmentExists( String principal )
  293. {
  294. return false; //To change body of implemented methods use File | Settings | File Templates.
  295. }
  296. @Override
  297. public boolean userAssignmentExists( UserAssignment assignment )
  298. {
  299. return false; //To change body of implemented methods use File | Settings | File Templates.
  300. }
  301. @Override
  302. public UserAssignment saveUserAssignment( UserAssignment userAssignment )
  303. throws RbacObjectInvalidException, RbacManagerException
  304. {
  305. return null; //To change body of implemented methods use File | Settings | File Templates.
  306. }
  307. @Override
  308. public UserAssignment getUserAssignment( String principal )
  309. throws RbacObjectNotFoundException, RbacManagerException
  310. {
  311. return null; //To change body of implemented methods use File | Settings | File Templates.
  312. }
  313. @Override
  314. public List<UserAssignment> getAllUserAssignments()
  315. throws RbacManagerException
  316. {
  317. return null; //To change body of implemented methods use File | Settings | File Templates.
  318. }
  319. @Override
  320. public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleNames )
  321. throws RbacManagerException
  322. {
  323. return null; //To change body of implemented methods use File | Settings | File Templates.
  324. }
  325. @Override
  326. public void removeUserAssignment( UserAssignment userAssignment )
  327. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  328. {
  329. //To change body of implemented methods use File | Settings | File Templates.
  330. }
  331. @Override
  332. public void removeUserAssignment( String principal )
  333. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  334. {
  335. //To change body of implemented methods use File | Settings | File Templates.
  336. }
  337. @Override
  338. public Collection<Role> getAssignedRoles( String principal )
  339. throws RbacObjectNotFoundException, RbacManagerException
  340. {
  341. return null; //To change body of implemented methods use File | Settings | File Templates.
  342. }
  343. @Override
  344. public Collection<Role> getAssignedRoles( UserAssignment userAssignment )
  345. throws RbacObjectNotFoundException, RbacManagerException
  346. {
  347. return null; //To change body of implemented methods use File | Settings | File Templates.
  348. }
  349. @Override
  350. public Collection<Role> getEffectivelyUnassignedRoles( String principal )
  351. throws RbacManagerException, RbacObjectNotFoundException
  352. {
  353. return null; //To change body of implemented methods use File | Settings | File Templates.
  354. }
  355. @Override
  356. public Collection<Role> getEffectivelyAssignedRoles( String principal )
  357. throws RbacObjectNotFoundException, RbacManagerException
  358. {
  359. return null; //To change body of implemented methods use File | Settings | File Templates.
  360. }
  361. @Override
  362. public Collection<Role> getUnassignedRoles( String principal )
  363. throws RbacManagerException, RbacObjectNotFoundException
  364. {
  365. return null; //To change body of implemented methods use File | Settings | File Templates.
  366. }
  367. @Override
  368. public Set<Permission> getAssignedPermissions( String principal )
  369. throws RbacObjectNotFoundException, RbacManagerException
  370. {
  371. return null; //To change body of implemented methods use File | Settings | File Templates.
  372. }
  373. @Override
  374. public Map<String, List<Permission>> getAssignedPermissionMap( String principal )
  375. throws RbacObjectNotFoundException, RbacManagerException
  376. {
  377. return null; //To change body of implemented methods use File | Settings | File Templates.
  378. }
  379. @Override
  380. public List<Role> getAllAssignableRoles()
  381. throws RbacManagerException, RbacObjectNotFoundException
  382. {
  383. return null; //To change body of implemented methods use File | Settings | File Templates.
  384. }
  385. @Override
  386. public Resource getGlobalResource()
  387. throws RbacManagerException
  388. {
  389. return null; //To change body of implemented methods use File | Settings | File Templates.
  390. }
  391. @Override
  392. public void eraseDatabase()
  393. {
  394. //To change body of implemented methods use File | Settings | File Templates.
  395. }
  396. @Override
  397. public boolean isReadOnly()
  398. {
  399. return false;
  400. }
  401. }