Skip to content
Snippets Groups Projects
Verified Commit 9600b8c1 authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier
Browse files

fix: user permissions on account and chatprofile

parent 511e6844
No related branches found
Tags v0.2.43
No related merge requests found
Pipeline #5693 passed
......@@ -122,6 +122,11 @@ class Account(Model):
)
rdf_context = {'picture': 'foaf:depiction'}
lookup_field = 'slug'
owner_field = 'user'
permission_classes = getattr(settings, 'USER_PERMISSION_CLASSES', [LDPPermissions])
anonymous_perms = getattr(settings, 'USER_ANONYMOUS_PERMISSIONS', ['view'])
authenticated_perms = getattr(settings, 'USER_AUTHENTICATED_PERMISSIONS', ['inherit'])
owner_perms = getattr(settings, 'USER_OWNER_PERMISSIONS', ['inherit'])
def __str__(self):
return '{} ({})'.format(self.user.get_full_name(), self.user.username)
......@@ -139,6 +144,11 @@ class ChatProfile(Model):
('control_chatprofile', 'Control'),
)
lookup_field = 'slug'
owner_field = 'user'
permission_classes = getattr(settings, 'USER_PERMISSION_CLASSES', [LDPPermissions])
anonymous_perms = getattr(settings, 'USER_ANONYMOUS_PERMISSIONS', ['view'])
authenticated_perms = getattr(settings, 'USER_AUTHENTICATED_PERMISSIONS', ['inherit'])
owner_perms = getattr(settings, 'USER_OWNER_PERMISSIONS', ['inherit'])
def __str__(self):
return '{} (jabberID: {})'.format(self.user.get_full_name(), self.jabberID)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment