Test coverage report: permission.backends.authenticate_backend

# permission.backends.authenticate_backend: 22 total statements, 57.9% covered

Generated: Thu 2012-03-01 14:22 CST

Source file: /home/alisue/Dropbox/Codes/django-permission/permission/backends/authenticate_backend.py

Stats: 11 executed, 8 missed, 3 excluded, 42 ignored

1. `# vim: set fileencoding=utf-8 :`
2. `"""`
3. `short module explanation`
4. ``
5. ``
6. `AUTHOR:`
7. `lambdalisue[Ali su ae] (lambdalisue@hashnote.net)`
8. ``
9. `License:`
10. `The MIT License (MIT)`
11. ``
12. `Copyright (c) 2012 Alisue allright reserved.`
13. ``
14. `Permission is hereby granted, free of charge, to any person obtaining a copy`
15. `of this software and associated documentation files (the "Software"), to`
16. `deal in the Software without restriction, including without limitation the`
17. `rights to use, copy, modify, merge, publish, distribute, sublicense, and/or`
18. `sell copies of the Software, and to permit persons to whom the Software is`
19. `furnished to do so, subject to the following conditions:`
20. ``
21. `The above copyright notice and this permission notice shall be included in`
22. `all copies or substantial portions of the Software.`
23. ``
24. `THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR`
25. `IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,`
26. `FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE`
27. `AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER`
28. `LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING`
29. `FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS`
30. `IN THE SOFTWARE.`
31. ``
32. `"""`
33. `from __future__ import with_statement`
34. `from django.contrib.auth.backends import ModelBackend as AuthModelBackend`
35. `from django.contrib.auth.backends import RemoteUserBackend as AuthRemoteUserBackend`
36. ``
37. `class ModelBackend(AuthModelBackend):`
38. `def get_group_permissions(self, user_obj, obj=None):`
39. `"""With django-permission, group permission is not available."""`
40. `return set()`
41. `def get_all_permissions(self, user_obj, obj=None):`
42. `"""with django-permission, user permission is not available."""`
43. `return set()`
44. `def has_perm(self, user_obj, perm, obj=None):`
45. `"""with django-permission, permission check is handled by PermissionBackend"""`
46. `return False`
47. `def has_module_perms(self, user_obj, app_label):`
48. `"""with django-permission, permission check is handled by PermissionBackend"""`
49. `return False`
50. ``
51. `class RemoteUserBackend(AuthRemoteUserBackend):`
52. `def get_group_permissions(self, user_obj, obj=None):`
53. `"""With django-permission, group permission is not available."""`
54. `return set()`
55. `def get_all_permissions(self, user_obj, obj=None):`
56. `"""with django-permission, user permission is not available."""`
57. `return set()`
58. `def has_perm(self, user_obj, perm, obj=None):`
59. `"""with django-permission, permission check is handled by PermissionBackend"""`
60. `return False`
61. `def has_module_perms(self, user_obj, app_label):`
62. `"""with django-permission, permission check is handled by PermissionBackend"""`
63. `return False`
64. ``