From f4a9a65e190baa6920b8d49fa141bfb93ecaf850 Mon Sep 17 00:00:00 2001
From: Thibaud Duquennoy <thibaud@duquennoy.fr>
Date: Fri, 15 Mar 2019 19:11:55 +0100
Subject: [PATCH] bugfix: object has no attribute permission_classes

bugfix: object has no attribute permission_classes
---
 djangoldp/serializers.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/djangoldp/serializers.py b/djangoldp/serializers.py
index 8c780454..eef36c04 100644
--- a/djangoldp/serializers.py
+++ b/djangoldp/serializers.py
@@ -207,8 +207,9 @@ class LDPSerializer(HyperlinkedModelSerializer):
     def get_permissions(self, obj):
         permissions = ['view', 'add', 'change', 'control', 'delete']
 
-        for permission_class in obj._meta.permission_classes:
-            permissions = permission_class().filter_user_perms(self.context['request'], obj, permissions)
+        if obj._meta.permission_classes:
+            for permission_class in obj._meta.permission_classes:
+                permissions = permission_class().filter_user_perms(self.context['request'], obj, permissions)
 
         permissions += get_perms(self.context['request'].user, obj)
         return [{'mode': {'@type': name.split('_')[0]}} for name in permissions]
-- 
GitLab