djangocms-blog
djangocms-blog copied to clipboard
Remove Blog toolbar if using multisite and current user does not have the rights to create a blog post on the current site
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")
?