File permission error (reopened)

I recently reported a file permission error and thought it was resolved but unfortunately it is not. When writing to a json file in the environment, I still get a PermissionError: [Errno 13] Permission denied: ‘tmp/scenarios.json’ error with the following code. Locally it works fine.

import streamlit as st
import os
import json

file_name = os.path.join("tmp", "scenarios.json")
def read_file(f):
    with open(f, 'r') as myfile:
    return data
def change_content(data):
    scenario = data["default"]
    scenario["num_people"] *= 2
    return data

def write_file(data, f):
    with open(f, 'w') as myfile:
        json.dump(data, myfile)

def main():
    st.title("test write on")
    st.write('version 0.0.1')
    data = read_file(file_name)
    st.write("after read")
    data = change_content(data)
    write_file(data, file_name)
    data = read_file(file_name)
    st.write("after write")

if __name__ == '__main__':