Wednesday, May 10, 2017

Re: Permissions for Anonymous Users in Django

On Wednesday 10 May 2017 09:49:48 Uzair Tariq wrote:

> Consider a scenario in which an anonymous user search for the user

> profiles on the google. He gets public profile link to different

> social network which he can view as the anonymous user but if this

> user is registered and authenticated user on the social site but his

> profile is inactive at the moment he won't be able to view even the

> public profiles as his permission to the profile will be revoke

> thanks to the is_active authentication check. By default in this case

> Anonymous user will have greater surfing space compared with the

> inactive user.

 

Negative.

 

An inactive user cannot log in, so for all intents and purposes she is an Anonymous user.

 

If you use a backend that allows logging in inactive users, then that's a bad choice to make. It's kind of the point of the is_active flag.

 

So either don't use the feature (use a custom user model that has no is_active flag) or use it and embrace it.

 

The reason for the is_active flag is that you can moderate bad conduct, lack of payments and so on. If you have no need for it, then that's a good case to implement a custom user model, but be aware, that you will have to delete staff accounts or unmark them as staff if they are no longer allowed to access to the admin.

--

Melvyn Sopacua

No comments:

Post a Comment