mkhorasani / Streamlit-Authenticator

A secure authentication module to validate user credentials in a Streamlit application.
Apache License 2.0
1.38k stars 229 forks source link

Adding groups when registering users #62

Closed Feromond closed 5 months ago

Feromond commented 1 year ago

I am a big fan of this current library and how simple it has made creating authentication within streamlit. One thing I am hoping that could be added is a group value for each user. I tested this implementation by modifying the library code directly for my project but I would hope there could be a true implementation created in the future.

I have attached a screenshot with the modified function to implement a simple base version. Here a group parameter is created with the value set to "default" representing a default group. From here, I can manage and modify group permissions in my code easily. I would love for this change to be implemented so upon user registration I can already have a default group preset onto each user, and then it is possible to make future modifications easily, even if this library did not directly support changes such as that.

I made this implementation on my personal project and then was able to control all permissions and assignment of different groups completely separate. This would just be a nice way to open the door for further access control within the app.

modified_function

I love the project, thanks for your contribution to open source!

mkhorasani commented 1 year ago

Hey @Feromond, thank you for reaching out with this idea. Please feel free to share your implementation/source code, perhaps you could further develop this and make a pull request? Cheers!

Feromond commented 1 year ago

Okay sounds good. I will work on this and create a pull request in the near future. Thanks!