fix(settings): grant the user access to their own settings object
ref: #485 #486
This commit is contained in:
@ -272,11 +272,20 @@ class OrganizationPermissionMixin(
|
||||
|
||||
try:
|
||||
|
||||
|
||||
if request.user.is_anonymous:
|
||||
|
||||
return False
|
||||
|
||||
|
||||
if (
|
||||
view.model.__name__ == 'UserSettings'
|
||||
and request._user.id == int(view.kwargs.get('pk', 0))
|
||||
):
|
||||
|
||||
return True
|
||||
|
||||
|
||||
object_organization: int = getattr(view.get_obj_organization( obj = obj ), 'id', None)
|
||||
|
||||
if object_organization:
|
||||
|
Reference in New Issue
Block a user