Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Blog toolbar if using multisite and current user does not have the rights to create a blog post on the current site #714

Open
corentinbettiol opened this issue Jan 25, 2023 · 0 comments

Comments

@corentinbettiol
Copy link
Contributor

Description

I would like to remove the Blog toolbar button if a user does not have the rights to create a blog post on the current site.

Use cases

You're a user with the rights to publish blog posts only on a site (site A). You visit another website (site B) that's using the Django/Django-CMS/Djangocms-Blog multisite framework. You go on the blog, and see that the "Blog" toolbar menu is available. You select "Blog" > "Add Post...", and are greeted by a "Add Blog Article" popup. If you only have the rights to post on site A you won't be able to select the website to post the article, so you may think that you're creating a blog post on the current site (site B), when in reality you're creating a blog post on site A.

Proposed solution

Add a condition alongside the self.request.user.has_perm("djangocms_blog.add_post") condition, maybe self.request.user.has_perm("djangocms_blog.add_post_current_site")?

@corentinbettiol corentinbettiol changed the title Remove Blog toolbar if using multisite and current user does not have the rights to post blog post on current site Remove Blog toolbar if using multisite and current user does not have the rights to create a blog post on the current site Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant