ComplexService.php 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /*
  3. * Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. namespace JMS\SecurityExtraBundle\Tests\Fixtures;
  18. use JMS\SecurityExtraBundle\Annotation\SecureReturn;
  19. use JMS\SecurityExtraBundle\Annotation\SecureParam;
  20. use JMS\SecurityExtraBundle\Annotation\Secure;
  21. interface E
  22. {
  23. /**
  24. * @SecureReturn(permissions="VIEW,UNDELETE")
  25. */
  26. public function retrieve();
  27. }
  28. interface F
  29. {
  30. /**
  31. * @SecureParam(name="secure", permissions="OWNER")
  32. * @SecureParam(name="foo", permissions="MASTER, EDIT")
  33. */
  34. public function delete($foo, $asdf, $secure);
  35. }
  36. interface C { }
  37. interface D extends F {}
  38. interface B extends C, E { }
  39. abstract class G implements F, E
  40. {
  41. /**
  42. * @Secure(roles="ROLE_FOO, IS_AUTHENTICATED_FULLY")
  43. * @SecureParam(name="secure", permissions="FOO")
  44. * @SecureReturn(permissions="WOW")
  45. */
  46. abstract public function abstractMethod($foo, $secure);
  47. }
  48. class A extends G implements C, B, D
  49. {
  50. public function retrieve() { }
  51. public function delete($one, $two, $three) { }
  52. public function abstractMethod($asdf, $wohoo) { }
  53. }
  54. class ComplexService extends A implements C { }