divio/aldryn-forms

Wrong permissions for EmailNotificationForm

wfehr opened this issue · 2 comments

wfehr commented

The content_type_id for the EmailNotificationForm-Plugin is wrong.
Currently the content_type_id for the EmailNotificationForm-Plugin is the same as for the FormPlugin-Plugin.
From my db:

DB> select * from django_content_type where app_label in ('aldryn_forms', 'email_notifications');
+-----+---------------------+-----------------------------+
| id | app_label | model |
+-----+---------------------+-----------------------------+
...
| 121 | aldryn_forms | formplugin |
...
| 126 | email_notifications | emailnotification |
| 127 | email_notifications | emailnotificationformplugin |
+-----+---------------------+-----------------------------+

DB> select * from auth_permission where content_type_id=121;
+-----+-------------------------------------------+-----------------+------------------------------------+
| id | name | content_type_id | codename |
+-----+-------------------------------------------+-----------------+------------------------------------+
| 367 | Can add email notification form plugin | 121 | add_emailnotificationformplugin |
| 349 | Can add form plugin | 121 | add_formplugin |
| 368 | Can change email notification form plugin | 121 | change_emailnotificationformplugin |
| 350 | Can change form plugin | 121 | change_formplugin |
| 369 | Can delete email notification form plugin | 121 | delete_emailnotificationformplugin |
| 351 | Can delete form plugin | 121 | delete_formplugin |
+-----+-------------------------------------------+-----------------+------------------------------------+

DB> select * from auth_permission where content_type_id=127;
Empty set (0.00 sec)

Installed:

  • django: 1.11.12
  • django-cms: 3.5.2
  • aldryn-forms: 3.0.3
wfehr commented

It seems like the above permissions error is a result of Djangos proxy-models, see related issue.

wfehr commented

Just saw pull-request #169, which might fix thix issue.