I need to allow administrators to manage permissions for models on my site. Groups, Users, and Permissions are doing a great job of this right now. However, I also need to allow the administrators to manage the permissions of non-authenticated users – Anonymous Users. The docs say that anonymous user’s group is always empty, so how can I allow administration of their permissions?
I need to allow administrators to manage permissions for models on my site. Groups,
Share
It is strange to add permissions to anonymous users. Docs say:
So you can set permissions to anon yuser, but with custom auth backend.
It is sometimes better to use declarative permission check, using decorators on the views with the needed permissions, like:
or leave it unrestricted for everyone(incl. anonymous user). Or some custom permission check..
Or if you want to have permissions anyway, you can always create a dummy user, let’s say "AnonUser", to give it permissions, and then checking permissions to have something like:
but this is something I’d never use..