If you haven't looked at it yet, here is OwnableAdmin, https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/admin.py#L192. This is what handles restricting BlogPosts to superusers or the user that created the post. In particular the get_queryset method enforces the restriction.
At this point you will need to create your own BlogPost admin as Ed suggested. I would have it inherit from the current BlogPostAdmin and then override the get_queryset method. You will need to add your own logic to allow certain users to see all BlogPosts and other users not to. I would use a modified version of OwnableAdmin's get_queryset and probably modify this line, https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/admin.py#L230, to also check if the user is a member of a particular group that you want to have access. Good luck! On Sun, Jul 19, 2015 at 3:21 PM, Déborah Leder <[email protected]> wrote: > Thank you both for your answers. > I think I wasn't very clear on one point : I don't want all staff users to > be moderators, but only some of them, some other users should only be > allowed to change and delete their own content. > Therefore, Josh, I can't use your suggestion. > And Eduardo, I didn't fully understand what a queryset is (eventhough I > read this paragraph > <https://docs.djangoproject.com/en/1.8/ref/models/querysets/#django.db.models.query.QuerySet>), > but I think that your method would have the same problem : I would just > replace the current permissions. > I really need there to be an additionnal permission for every model. > > So, given that, do you have an idea ? > > -- > You received this message because you are subscribed to the Google Groups > "Mezzanine Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
