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 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  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#test")
  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 Role createRole( String id, String name )
  70. {
  71. return null;
  72. }
  73. @Override
  74. public boolean roleExists( String name )
  75. {
  76. return false;
  77. }
  78. @Override
  79. public boolean roleExistsById( String id ) throws RbacManagerException
  80. {
  81. return false;
  82. }
  83. @Override
  84. public boolean roleExists( Role role )
  85. {
  86. return false;
  87. }
  88. @Override
  89. public Role saveRole( Role role )
  90. throws RbacObjectInvalidException, RbacManagerException
  91. {
  92. return null;
  93. }
  94. @Override
  95. public void saveRoles( Collection<Role> roles )
  96. throws RbacObjectInvalidException, RbacManagerException
  97. {
  98. }
  99. @Override
  100. public Role getRole( String roleName )
  101. throws RbacObjectNotFoundException, RbacManagerException
  102. {
  103. return null;
  104. }
  105. @Override
  106. public Role getRoleById( String id ) throws RbacObjectNotFoundException, RbacManagerException
  107. {
  108. return null;
  109. }
  110. @Override
  111. public Map<String, Role> getRoles( Collection<String> roleNames )
  112. throws RbacObjectNotFoundException, RbacManagerException
  113. {
  114. return null; //To change body of implemented methods use File | Settings | File Templates.
  115. }
  116. @Override
  117. public void addChildRole( Role role, Role childRole )
  118. throws RbacObjectInvalidException, RbacManagerException
  119. {
  120. //To change body of implemented methods use File | Settings | File Templates.
  121. }
  122. @Override
  123. public Map<String, Role> getChildRoleNames( Role role )
  124. throws RbacManagerException
  125. {
  126. return null; //To change body of implemented methods use File | Settings | File Templates.
  127. }
  128. @Override
  129. public Map<String, ? extends Role> getChildRoleIds( Role role ) throws RbacManagerException
  130. {
  131. return null;
  132. }
  133. @Override
  134. public Map<String, Role> getParentRoleNames( Role role )
  135. throws RbacManagerException
  136. {
  137. return null; //To change body of implemented methods use File | Settings | File Templates.
  138. }
  139. @Override
  140. public Map<String, ? extends Role> getParentRoleIds( Role role ) throws RbacManagerException
  141. {
  142. return null;
  143. }
  144. @Override
  145. public List<Role> getAllRoles()
  146. throws RbacManagerException
  147. {
  148. return null; //To change body of implemented methods use File | Settings | File Templates.
  149. }
  150. @Override
  151. public Set<Role> getEffectiveRoles( Role role )
  152. throws RbacObjectNotFoundException, RbacManagerException
  153. {
  154. return null; //To change body of implemented methods use File | Settings | File Templates.
  155. }
  156. @Override
  157. public void removeRole( Role role )
  158. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  159. {
  160. //To change body of implemented methods use File | Settings | File Templates.
  161. }
  162. @Override
  163. public void removeRole( String roleName )
  164. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  165. {
  166. //To change body of implemented methods use File | Settings | File Templates.
  167. }
  168. @Override
  169. public void removeRoleById( String id ) throws RbacObjectNotFoundException, RbacManagerException
  170. {
  171. }
  172. @Override
  173. public Permission createPermission( String name )
  174. throws RbacManagerException
  175. {
  176. return null; //To change body of implemented methods use File | Settings | File Templates.
  177. }
  178. @Override
  179. public Permission createPermission( String name, String operationName, String resourceIdentifier )
  180. throws RbacManagerException
  181. {
  182. return null; //To change body of implemented methods use File | Settings | File Templates.
  183. }
  184. @Override
  185. public boolean permissionExists( String name )
  186. {
  187. return false; //To change body of implemented methods use File | Settings | File Templates.
  188. }
  189. @Override
  190. public boolean permissionExists( Permission permission )
  191. {
  192. return false; //To change body of implemented methods use File | Settings | File Templates.
  193. }
  194. @Override
  195. public Permission savePermission( Permission permission )
  196. throws RbacObjectInvalidException, RbacManagerException
  197. {
  198. return null; //To change body of implemented methods use File | Settings | File Templates.
  199. }
  200. @Override
  201. public Permission getPermission( String permissionName )
  202. throws RbacObjectNotFoundException, RbacManagerException
  203. {
  204. return null; //To change body of implemented methods use File | Settings | File Templates.
  205. }
  206. @Override
  207. public List<Permission> getAllPermissions()
  208. throws RbacManagerException
  209. {
  210. return null; //To change body of implemented methods use File | Settings | File Templates.
  211. }
  212. @Override
  213. public void removePermission( Permission permission )
  214. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  215. {
  216. //To change body of implemented methods use File | Settings | File Templates.
  217. }
  218. @Override
  219. public void removePermission( String permissionName )
  220. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  221. {
  222. //To change body of implemented methods use File | Settings | File Templates.
  223. }
  224. @Override
  225. public Operation createOperation( String name )
  226. throws RbacManagerException
  227. {
  228. return null; //To change body of implemented methods use File | Settings | File Templates.
  229. }
  230. @Override
  231. public boolean operationExists( String name )
  232. {
  233. return false; //To change body of implemented methods use File | Settings | File Templates.
  234. }
  235. @Override
  236. public boolean operationExists( Operation operation )
  237. {
  238. return false;
  239. }
  240. @Override
  241. public Operation saveOperation( Operation operation )
  242. throws RbacObjectInvalidException, RbacManagerException
  243. {
  244. return null;
  245. }
  246. @Override
  247. public Operation getOperation( String operationName )
  248. throws RbacObjectNotFoundException, RbacManagerException
  249. {
  250. return null;
  251. }
  252. @Override
  253. public List<Operation> getAllOperations()
  254. throws RbacManagerException
  255. {
  256. return null;
  257. }
  258. @Override
  259. public void removeOperation( Operation operation )
  260. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  261. {
  262. }
  263. @Override
  264. public void removeOperation( String operationName )
  265. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  266. {
  267. }
  268. @Override
  269. public Resource createResource( String identifier )
  270. throws RbacManagerException
  271. {
  272. return null;
  273. }
  274. @Override
  275. public boolean resourceExists( String identifier )
  276. {
  277. return false; //To change body of implemented methods use File | Settings | File Templates.
  278. }
  279. @Override
  280. public boolean resourceExists( Resource resource )
  281. {
  282. return false; //To change body of implemented methods use File | Settings | File Templates.
  283. }
  284. @Override
  285. public Resource saveResource( Resource resource )
  286. throws RbacObjectInvalidException, RbacManagerException
  287. {
  288. return null; //To change body of implemented methods use File | Settings | File Templates.
  289. }
  290. @Override
  291. public Resource getResource( String resourceIdentifier )
  292. throws RbacObjectNotFoundException, RbacManagerException
  293. {
  294. return null; //To change body of implemented methods use File | Settings | File Templates.
  295. }
  296. @Override
  297. public List<Resource> getAllResources()
  298. throws RbacManagerException
  299. {
  300. return null; //To change body of implemented methods use File | Settings | File Templates.
  301. }
  302. @Override
  303. public void removeResource( Resource resource )
  304. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  305. {
  306. //To change body of implemented methods use File | Settings | File Templates.
  307. }
  308. @Override
  309. public void removeResource( String resourceIdentifier )
  310. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  311. {
  312. //To change body of implemented methods use File | Settings | File Templates.
  313. }
  314. @Override
  315. public UserAssignment createUserAssignment( String principal )
  316. throws RbacManagerException
  317. {
  318. return null; //To change body of implemented methods use File | Settings | File Templates.
  319. }
  320. @Override
  321. public boolean userAssignmentExists( String principal )
  322. {
  323. return false; //To change body of implemented methods use File | Settings | File Templates.
  324. }
  325. @Override
  326. public boolean userAssignmentExists( UserAssignment assignment )
  327. {
  328. return false; //To change body of implemented methods use File | Settings | File Templates.
  329. }
  330. @Override
  331. public UserAssignment saveUserAssignment( UserAssignment userAssignment )
  332. throws RbacObjectInvalidException, RbacManagerException
  333. {
  334. return null; //To change body of implemented methods use File | Settings | File Templates.
  335. }
  336. @Override
  337. public UserAssignment getUserAssignment( String principal )
  338. throws RbacObjectNotFoundException, RbacManagerException
  339. {
  340. return null; //To change body of implemented methods use File | Settings | File Templates.
  341. }
  342. @Override
  343. public List<UserAssignment> getAllUserAssignments()
  344. throws RbacManagerException
  345. {
  346. return null; //To change body of implemented methods use File | Settings | File Templates.
  347. }
  348. @Override
  349. public List<UserAssignment> getUserAssignmentsForRoles( Collection<String> roleIds )
  350. throws RbacManagerException
  351. {
  352. return null; //To change body of implemented methods use File | Settings | File Templates.
  353. }
  354. @Override
  355. public void removeUserAssignment( UserAssignment userAssignment )
  356. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  357. {
  358. //To change body of implemented methods use File | Settings | File Templates.
  359. }
  360. @Override
  361. public void removeUserAssignment( String principal )
  362. throws RbacObjectNotFoundException, RbacObjectInvalidException, RbacManagerException
  363. {
  364. //To change body of implemented methods use File | Settings | File Templates.
  365. }
  366. @Override
  367. public Collection<Role> getAssignedRoles( String principal )
  368. throws RbacObjectNotFoundException, RbacManagerException
  369. {
  370. return null; //To change body of implemented methods use File | Settings | File Templates.
  371. }
  372. @Override
  373. public Collection<Role> getAssignedRoles( UserAssignment userAssignment )
  374. throws RbacObjectNotFoundException, RbacManagerException
  375. {
  376. return null; //To change body of implemented methods use File | Settings | File Templates.
  377. }
  378. @Override
  379. public Collection<Role> getEffectivelyUnassignedRoles( String principal )
  380. throws RbacManagerException, RbacObjectNotFoundException
  381. {
  382. return null; //To change body of implemented methods use File | Settings | File Templates.
  383. }
  384. @Override
  385. public Collection<Role> getEffectivelyAssignedRoles( String principal )
  386. throws RbacObjectNotFoundException, RbacManagerException
  387. {
  388. return null; //To change body of implemented methods use File | Settings | File Templates.
  389. }
  390. @Override
  391. public Collection<Role> getUnassignedRoles( String principal )
  392. throws RbacManagerException, RbacObjectNotFoundException
  393. {
  394. return null; //To change body of implemented methods use File | Settings | File Templates.
  395. }
  396. @Override
  397. public Set<Permission> getAssignedPermissions( String principal )
  398. throws RbacObjectNotFoundException, RbacManagerException
  399. {
  400. return null; //To change body of implemented methods use File | Settings | File Templates.
  401. }
  402. @Override
  403. public Map<String, List<? extends Permission>> getAssignedPermissionMap( String principal )
  404. throws RbacObjectNotFoundException, RbacManagerException
  405. {
  406. return null; //To change body of implemented methods use File | Settings | File Templates.
  407. }
  408. @Override
  409. public List<Role> getAllAssignableRoles()
  410. throws RbacManagerException, RbacObjectNotFoundException
  411. {
  412. return null; //To change body of implemented methods use File | Settings | File Templates.
  413. }
  414. @Override
  415. public Resource getGlobalResource()
  416. throws RbacManagerException
  417. {
  418. return null; //To change body of implemented methods use File | Settings | File Templates.
  419. }
  420. @Override
  421. public void eraseDatabase()
  422. {
  423. //To change body of implemented methods use File | Settings | File Templates.
  424. }
  425. @Override
  426. public boolean isReadOnly()
  427. {
  428. return false;
  429. }
  430. }