diff options
Diffstat (limited to 'tools/pharos-dashboard/dashboard/views/registration.py')
-rw-r--r-- | tools/pharos-dashboard/dashboard/views/registration.py | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/tools/pharos-dashboard/dashboard/views/registration.py b/tools/pharos-dashboard/dashboard/views/registration.py deleted file mode 100644 index 516fb298..00000000 --- a/tools/pharos-dashboard/dashboard/views/registration.py +++ /dev/null @@ -1,16 +0,0 @@ -from django.contrib.auth.mixins import UserPassesTestMixin - - -class BookingUserTestMixin(UserPassesTestMixin): - # Test if a user has permission to book this Pod - def test_func(self): - user = self.request.user - # Check if User is troubleshooter / admin - if user.has_perm(('dashboard.add_booking')): - return True - # Check if User owns this resource - user_resources = user.userresource_set.get_queryset() - for user_resource in user_resources: - if user_resource.resource_id == self.resource.resource_id: - return True - return False |