Add functions to split read and write permissions.

master
Tom Hacohen 4 years ago
parent 63afcc0830
commit 6c05a7898a

@ -33,14 +33,36 @@ class AppSettings:
@cached_property
def API_PERMISSIONS(self): # pylint: disable=invalid-name
"""
Deprecated. Do not use.
"""
perms = self._setting("API_PERMISSIONS", ("rest_framework.permissions.IsAuthenticated",))
ret = []
for perm in perms:
ret.append(self.import_from_str(perm))
return ret
@cached_property
def API_PERMISSIONS_READ(self): # pylint: disable=invalid-name
perms = self._setting("API_PERMISSIONS_READ", tuple())
ret = []
for perm in perms:
ret.append(self.import_from_str(perm))
return ret
@cached_property
def API_PERMISSIONS_WRITE(self): # pylint: disable=invalid-name
perms = self._setting("API_PERMISSIONS_WRITE", tuple())
ret = []
for perm in perms:
ret.append(self.import_from_str(perm))
return ret
@cached_property
def API_AUTHENTICATORS(self): # pylint: disable=invalid-name
"""
Deprecated. Do not use.
"""
perms = self._setting(
"API_AUTHENTICATORS",
(

Loading…
Cancel
Save