Skip to content

Commit 500c1a7

Browse files
committed
Do not send processors if no write permissions
1 parent e123f83 commit 500c1a7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/serializers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def get_has_footer(self, obj):
129129
return not profile.is_pro_subscriber() and not profile.organization
130130

131131
def get_last_modified_by_email(self, obj):
132-
return obj.last_modified_by.email if obj.last_modified_by else None
132+
return obj.last_modified_by.email if obj.last_modified_by and obj.has_write_permission(self._request_user) else None
133133

134134
def get_owner_email(self, obj):
135135
return obj.owner.email if obj.has_write_permission(self._request_user) else None
@@ -140,7 +140,9 @@ def get_output_template(self, obj):
140140
def get_data(self, obj):
141141
app_data = AppData.objects.filter(
142142
app_uuid=obj.uuid).order_by('-created_at').first()
143-
if app_data:
143+
if app_data and app_data.data:
144+
if not obj.has_write_permission(self._request_user):
145+
app_data.data.pop('processors', None)
144146
return app_data.data
145147
return None
146148

0 commit comments

Comments
 (0)