question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Placeholder outside of CMS Permissions issue

See original GitHub issue

I am building an application that uses the PlaceholderField in a model, but cannot seem to get the permissions working correctly. According to the documentation:

Permissions To be able to edit a placeholder user must be a staff member and needs either edit permissions on the model that contains the PlaceholderField, or permissions for that specific instance of that model. Required permissions for edit actions are:

  • to add: require add or change permission on related Model or instance.
  • to change: require add or change permission on related Model or instance.
  • to delete: require add or change or delete permission on related Model or instance.

So I built my model:

class UserProfile(models.Model):
    user = models.OneToOneField(User, related_name='user_profile')
    address = models.CharField(max_length=55, blank=True, null=True,
                                                   help_text="Home Address, ex: 111 Street Addr")
     address2 = models.CharField(max_length=55, blank=True, null=True,
                                                      help_text="City, State Zip Code")
    phone = models.CharField(max_length=12, blank=True, null=True)
    facebook = models.URLField(blank=True, null=True)
    twitter = models.URLField(blank=True, null=True)
    google_plus = models.URLField(blank=True, null=True)
    user_info_placeholder = PlaceholderField('UserInfoPlaceholder',
                                                                         related_name='userinfoplaceholder')
    timeline = PlaceholderField('TimelinePlaceholder', related_name='timeline')

Added a view:

class UserProfileDetailView(DetailView):
    context_object_name = 'user_information'
    model = User
    slug_field = 'username'
    template_name = 'home_page.html'

And logged in as the user, however no ‘Structure/Content’ button appeared on the toolbar. To check I logged in as a superuser and the button showed. So I changed the users “User Permissions” and added everything just to be sure, but still not ‘Structure/Content’ button.

Any suggestions?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
patchwork-systemscommented, Jun 19, 2016

@czpython I just checked this solution in my code and that was the problem. Once I added PlaceholderAdminMixin everything started working! Thanks for the fix!

1reaction
czpythoncommented, Jun 14, 2016

I believe this is both a validation and documentation problem. I can reproduce the issue only if the admin class for the object that has the PlaceholderField does not subclass from PlaceholderAdminMixin.

Will open a new ticket for the documentation issue and close this one for https://github.com/divio/django-cms/issues/3734

Read more comments on GitHub >

github_iconTop Results From Across the Web

Placeholder outside of CMS Permissions issue #5178 - GitHub
I am building an application that uses the PlaceholderField in a model, but cannot seem to get the permissions working correctly.
Read more >
How to use placeholders outside the CMS
Placeholders can be viewed as containers for CMSPlugin instances, and can be used outside the CMS in custom applications using the PlaceholderField ....
Read more >
5. Placeholders outside the CMS - Read the Docs
Placeholders can be viewed as containers for CMSPlugin instances, and can be used outside the CMS in custom applications using the PlaceholderField.
Read more >
django-cms "You do not have permission to add a plugin" as ...
I installed django-cms 3.0.6 (the latest version as of today) on top of an existing Django 1.7 / Python 2.7 project with sqlite3...
Read more >
Medicare Claims Processing Manual - Chapter 27 - CMS
60.3 - Contractor Monthly Reports of Claims Paid Outside of CWF ... Montana (HUEP), Prior Authorization (HUPA),and IVIG error codes are also ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found