added RO DRF permission and internal_note filters for invite/userspace

This commit is contained in:
vabene1111
2023-07-03 21:59:15 +02:00
parent 3545b6e98a
commit ac1d641bd5
2 changed files with 16 additions and 0 deletions

View File

@ -434,3 +434,10 @@ def switch_user_active_space(user, space):
return us
except ObjectDoesNotExist:
return None
class IsReadOnlyDRF(permissions.BasePermission):
message = 'You cannot interact with this object as it is not owned by you!'
def has_permission(self, request, view):
return request.method in SAFE_METHODS