Add option to lock widgets

Hello,

I have a web app where I want some (super) users to be able to interact with widgets, but I also want most users to only see the default values.

Any ideas if this is doable in the current Streamlit version (86.0)?

Here is some code to illustrate the idea:

import streamlit as st

user_type = st.radio('What kind of user are you?', ['user', 'superuser'])

frozen = False if user_type == 'superuser' else True

report_date = st.date_input('Report Date', frozen=frozen)

The idea is that only a superuser should be able to change the report_date.

it is not difficult, you can add if to decide what that different user can see
for example:

import streamlit as st

user_type = st.radio('What kind of user are you?', ['user', 'superuser'])
if user_type =="user":
      #put the code that you want to show to user
elif user_type =="superuser":
     #put the code that you want to show to superuser