obervinov / users-package

This Python module is designed to simplify user management in Telegram bots, providing the necessary functionality for tasks such as user authentication, authorization and compliance with speed limits, ensuring effective management of user attributes and access rights.
MIT License
1 stars 0 forks source link

Change permissions attribute to list with exist roles #29

Closed obervinov closed 8 months ago

obervinov commented 8 months ago

Context: Now the user_access_check() and authorization() methods return the verdict allowed or denied after checking the role. This is an inconvenient situation when you need to check for example several roles. https://github.com/obervinov/users-package/blob/v2.0.0/users/users.py#L333C9-L333C22 https://github.com/obervinov/users-package/blob/v2.0.0/users/users.py#L194

To-Do: Instead of the verdict string, you need to return a dictionary with a list of all existing user roles {'permissions': ['role1', 'role2']}