From 750bdcb2c55ee239e7270b6ebc8c8784ca58a52a Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Wed, 29 Jul 2020 12:25:53 +0200 Subject: [PATCH] Treasurers can of course click on buttons. Fix PATCH requests on the API --- apps/permission/fixtures/initial.json | 27 +++++++++++++++++++++++++-- apps/permission/permissions.py | 4 ++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/apps/permission/fixtures/initial.json b/apps/permission/fixtures/initial.json index 2131ee7b..0c128f5c 100644 --- a/apps/permission/fixtures/initial.json +++ b/apps/permission/fixtures/initial.json @@ -2119,6 +2119,22 @@ "description": "Update the clothing size field of my own WEI Registration" } }, + { + "model": "permission.permission", + "pk": 132, + "fields": { + "model": [ + "note", + "recurrenttransaction" + ], + "query": "{}", + "type": "add", + "mask": 2, + "field": "", + "permanent": false, + "description": "Create any recurrent transaction" + } + }, { "model": "permission.role", "pk": 1, @@ -2279,7 +2295,8 @@ 69, 71, 72, - 73 + 73, + 132 ] } }, @@ -2415,7 +2432,13 @@ 123, 124, 125, - 126 + 126, + 127, + 128, + 129, + 130, + 131, + 132 ] } }, diff --git a/apps/permission/permissions.py b/apps/permission/permissions.py index 40321567..03f07992 100644 --- a/apps/permission/permissions.py +++ b/apps/permission/permissions.py @@ -19,8 +19,8 @@ class StrongDjangoObjectPermissions(DjangoObjectPermissions): 'OPTIONS': [], 'HEAD': [], 'POST': ['%(app_label)s.add_%(model_name)s'], - 'PUT': ['%(app_label)s.change_%(model_name)s'], - 'PATCH': ['%(app_label)s.change_%(model_name)s'], + 'PUT': [], # ['%(app_label)s.change_%(model_name)s'], + 'PATCH': [], # ['%(app_label)s.change_%(model_name)s'], 'DELETE': ['%(app_label)s.delete_%(model_name)s'], }