1

I am using the great django-guardian to manage per object permissions on a project. In such project I will like all users be granted a permission (view, for instance) to all public objects.

As far as I know the only way to do this is granting each user the permission for each public object every-time an account is created.

Is there a better way such as leaving an object with a "wild card" permission or something similar. Is using a group the best?

Feedback is appreciated.

jdcaballerov
  • 1,452
  • 1
  • 12
  • 16
  • 1
    Did you ever come up with a clean solution for this? – Jamie S May 17 '16 at 03:53
  • Not quite @JamieStrauss: I followed Leonardo's advice: A group is created for all users inside a migration, then a signal attached to user creation (activation) makes every user a member of the group. – jdcaballerov May 17 '16 at 14:35
  • Thanks jdcaballerov, this ended up being the approach I took also. – Jamie S May 19 '16 at 08:52

1 Answers1

3

My recommendation is to assign all the users when created a group and provide access to the models with the default group in the definition of the model, as described here: https://django-guardian.readthedocs.org/en/v1.2/userguide/assign.html

Leonardo
  • 2,484
  • 2
  • 25
  • 37