Question

I need to add view only settings for django CMS. But I found it missing in my settings. Here is a screenshot

enter image description here

It has all other settings other than cms | pagina | Can view page setting. I tried fixing it by adding

CMS_PUBLIC_FOR = 'all'
CMS_PERMISSION = True

Here is a bit more information. When I checked all permission of the root user, I found that permission missing.

u'cms.add_cmsplugin',
u'cms.add_file',
u'cms.add_flash',
u'cms.add_globalpagepermission',
u'cms.add_googlemap',
u'cms.add_link',
u'cms.add_page',
u'cms.add_pagemoderator',
u'cms.add_pagemoderatorstate',
u'cms.add_pagepermission',
u'cms.add_pageuser',
u'cms.add_pageusergroup',
u'cms.add_placeholder',
u'cms.add_snippet',
u'cms.add_snippetptr',
u'cms.add_teaser',
u'cms.add_title',
u'cms.add_twitterrecententries',
u'cms.add_video',
u'cms.change_cmsplugin',
u'cms.change_file',
u'cms.change_flash',
u'cms.change_globalpagepermission',
u'cms.change_googlemap',
u'cms.change_link',
u'cms.change_page',
u'cms.change_pagemoderator',
u'cms.change_pagemoderatorstate',
u'cms.change_pagepermission',
u'cms.change_pageuser',
u'cms.change_pageusergroup',
u'cms.change_placeholder',
u'cms.change_snippet',
u'cms.change_snippetptr',
u'cms.change_teaser',
u'cms.change_title',
u'cms.change_twitterrecententries',
u'cms.change_video',
u'cms.delete_cmsplugin',
u'cms.delete_file',
u'cms.delete_flash',
u'cms.delete_globalpagepermission',
u'cms.delete_googlemap',
u'cms.delete_link',
u'cms.delete_page',
u'cms.delete_pagemoderator',
u'cms.delete_pagemoderatorstate',
u'cms.delete_pagepermission',
u'cms.delete_pageuser',
u'cms.delete_pageusergroup',
u'cms.delete_placeholder',
u'cms.delete_snippet',
u'cms.delete_snippetptr',
u'cms.delete_teaser',
u'cms.delete_title',
u'cms.delete_twitterrecententries',
u'cms.delete_video',
u'cms.publish_page',}

but failed to fix the issue. I am not sure what is a good way to debug this. Thanks in advance.

Was it helpful?

Solution

It was a simple solution I found out here https://djangosnippets.org/snippets/698/

# Add any missing permissions

from django.contrib.auth.management import create_permissions
from django.db.models import get_apps
for app in get_apps():
    create_permissions(app, None, 2)

This gets the remaining permissions that were missing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top