LonelyVikingMichael / litestar-users

Authentication and user management for the Litestar framework
https://lonelyvikingmichael.github.io/litestar-users/
MIT License
42 stars 12 forks source link

Enhancement: Make `roles` a seperate mixin #24

Closed LonelyVikingMichael closed 1 year ago

LonelyVikingMichael commented 1 year ago

With the merge of #23 , role based authorization is no longer a given. We should remove the roles relationship from the User mixin and make it a seperate opt-in.

Not only will this be cleaner, it will also allow for something like this wherever roles are integrated:

if not hasattr(request.user, 'roles'):
    raise ImproperlyConfiguredException("user roles are not set up")