These are chat archives for django/django

31st
Jul 2015
Charles Javelona
@charlesjavelona
Jul 31 2015 03:59 UTC
Hi, I am confuse as to how to prevent users into editing an article that they did not publish through url. I was already able to hide the buttons to edit or delete if they are not the owner.
How do I do this.
Mir Nazim
@mnazim
Jul 31 2015 05:16 UTC
@charlesakio I usually implement a method on the Model. E.g, if user is project owner Project.visible_to(self, user) method should return true of false based on what ever criteria
This is among simpler way. If you need fine grained control, you probably need somethig like django-gaurdian.
Charles Javelona
@charlesjavelona
Jul 31 2015 14:10 UTC
I see, @mnazim I did consider using django-guardian, just not familiar with permissions yet.