| Conditions | 1 |
| Total Lines | 11 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from django.contrib.auth.models import User |
||
| 47 | def is_authorized(self, user): |
||
| 48 | """ |
||
| 49 | Method: is_authorized |
||
| 50 | |||
| 51 | A user is athorized to browse a project if he is the owner or member of the project |
||
| 52 | |||
| 53 | Returns: |
||
| 54 | {bool} |
||
| 55 | """ |
||
| 56 | return (self.owner == user) or ( |
||
| 57 | self.users.all().filter(id=user.id).exists()) |
||
| 58 |