mkhorasani / Streamlit-Authenticator

A secure authentication module to manage user access in a Streamlit application.
Other
1.56k stars 248 forks source link

add minimalistic rigths grouping system by extending the yaml with aditional Key "group" #23

Closed sgaechter closed 8 months ago

sgaechter commented 2 years ago

In one of my Streamlit applications, I wanted to distribute permissions to different users using groups. Therefore I extended Streamlit-Authenticator with another field. For this, I created the key "users" in YAML. So that existing cookies do not lead to a key error I extended the function " _token_decode" by a query, which sets the "st.session_state['group']" to "None" if the object is not present.

mkhorasani commented 8 months ago

Hi @sgaechter, I recommend you simply add a new field to the credentials dictionary in the config file to accommodate this request without refactoring the library itself. There are multiple requests of similar nature so it would only make sense if each developer took it upon themselves to add a new field to the config file as they see fit. Thank you.