Hi Adam, 

Thanks for the feedback! 

I tried to leverage app auth framework to customize User, Permission, 
Group, PermissionMixin models. 

As for the User it works normally. There is the possibility to extend the 
models and place the db_table in the User Meta. There is also a constant 
AUTH_USER_MODEL to identify the CustomUser model that will be used for 
authentication. There are also the constant USERNAME_FIELD, EMAIL_FIELD to 
identify the model fields. 

The documentation also contains guidance on the AUTHENTICATION_BACKENDS 
constant to customize the authentication rules. 

I suggest the possibility of thinking about having similar constants for 
the Permission, Group, PermissionMixin models for a next update. 

For example, for the Pemisson model we can access it alternatively through 
an identification of a constant AUTH_PERMISSION_MODEL. The rest likewise 
AUTH_GROUP_MODEL, AUTH_USER_PERMISSIONS_MODEL, AUTH_USER_GROUPS_MODEL, 
AUTH_GROUP_PERMISSION_MODEL. 

It could also have the possibility of constants to identify the name of the 
fields in each of these models of the Auth app. For Permission would have: 
NAME, CODENAME. For Group it would have: NAME.

Respectfully,

Jansen

Em quarta-feira, 15 de fevereiro de 2023 às 14:06:20 UTC-3, Adam Johnson 
escreveu:

> Hi Jansen,
>
> I would like to see a more concrete and thought-out proposal, with the 
> motivation. For many problems you might encounter with the auth module, 
> there is a way to customize it. Beyond a certain point though, “reimplement 
> it yourself” is a reasonable solution. For example, if you need a different 
> database table name for Group, I’d say that would be grounds to implement 
> your own Group model - which really isn’t much code.
>
> Thanks,
>
> Adam
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/065862c1-8082-4217-aca8-96e2e379955fn%40googlegroups.com.
  • Cus... Jansen Magalhães
    • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
      • ... Jansen Magalhães

Reply via email to