function deactivateReadOnly(){
    // Activate save button
    w2ui['toolbar'].enable('file:save_sod');

    // Deal with locks
    w2ui['toolbar'].enable('file:release_lock');
    w2ui['toolbar'].disable('file:request_lock');
    w2ui['toolbar'].disable('file:force_unlock');

    //remove buttons in grids
    w2ui.grd_timeline.toolbar.enable("add","remove","import","export")
    w2ui.grd_investigated_systems.toolbar.enable("add","remove","import","export")
    w2ui.grd_malware.toolbar.enable("add","remove","import","export")
    w2ui.grd_accounts.toolbar.enable("add","remove","import","export")
    w2ui.grd_network.toolbar.enable("add","remove","import","export")
    w2ui.grd_exfiltration.toolbar.enable("add","remove","import","export")
    w2ui.grd_osint.toolbar.enable("add","remove","import","export")
    w2ui.grd_systems.toolbar.enable("add","remove","import","export")
    w2ui.grd_casenotes.toolbar.enable("add","remove","import","export")
    w2ui.grd_investigators.toolbar.enable("add","remove","import","export")
    w2ui.grd_evidence.toolbar.enable("add","remove","import","export")

    lockstate = "&#128272; Case unlocked (edits allowed)"
    $( "#lock" ).html(lockstate)

    //activate grid editable

    writeenable_grid(w2ui.grd_timeline,config.grd_timeline)
    writeenable_grid(w2ui.grd_investigated_systems,config.grd_investigated_systems)
    writeenable_grid(w2ui.grd_malware,config.grd_malware)
    writeenable_grid(w2ui.grd_accounts,config.grd_accounts)
    writeenable_grid(w2ui.grd_network,config.grd_network)
    writeenable_grid(w2ui.grd_exfiltration,config.grd_exfiltration)
    writeenable_grid(w2ui.grd_osint,config.grd_osint)
    writeenable_grid(w2ui.grd_systems,config.grd_systems)
    writeenable_grid(w2ui.grd_actions,config.grd_actions)
    writeenable_grid(w2ui.grd_casenotes,config.grd_casenotes)
    writeenable_grid(w2ui.grd_investigators,config.grd_investigators)
    writeenable_grid(w2ui.grd_evidence,config.grd_evidence)

    //activate context menus
    activate_all_context_items(w2ui.grd_timeline.menu)
    activate_all_context_items(w2ui.grd_investigated_systems.menu)
    activate_all_context_items(w2ui.grd_malware.menu)
    activate_all_context_items(w2ui.grd_accounts.menu)
    activate_all_context_items(w2ui.grd_network.menu)
    activate_all_context_items(w2ui.grd_exfiltration.menu)
    activate_all_context_items(w2ui.grd_osint.menu)
    activate_all_context_items(w2ui.grd_systems.menu)
    activate_all_context_items(w2ui.grd_investigators.menu)
    activate_all_context_items(w2ui.grd_evidence.menu)
    activate_all_context_items(w2ui.grd_actions.menu)
    activate_all_context_items(w2ui.grd_casenotes.menu)

    //repropagate dropdowns
    w2ui.grd_timeline.getColumn('owner').editable.items = case_data.investigators
    w2ui.grd_timeline.getColumn('event_host').editable.items = case_data.systems
    w2ui.grd_timeline.getColumn('event_source_host').editable.items = case_data.systems
    w2ui.grd_timeline.getColumn('direction').editable.items = case_data.direction
    w2ui.grd_investigated_systems.getColumn('analyst').editable.items = case_data.investigators
    w2ui.grd_investigated_systems.getColumn('hostname').editable.items = case_data.systems
    w2ui.grd_malware.getColumn('hostname').editable.items = case_data.systems
    w2ui.grd_network.getColumn('malware').editable.items = case_data.malware
    w2ui.grd_exfiltration.getColumn('stagingsystem').editable.items = case_data.systems
    w2ui.grd_exfiltration.getColumn('original').editable.items = case_data.systems
    w2ui.grd_exfiltration.getColumn('exfil_to').editable.items = case_data.systems
    w2ui.grd_actions.getColumn('owner').editable.items = case_data.investigators
    w2ui.grd_casenotes.getColumn('owner').editable.items = case_data.investigators

    w2ui.grd_timeline.refresh()
    w2ui.grd_investigated_systems.refresh()
    w2ui.grd_malware.refresh()
    w2ui.grd_accounts.refresh()
    w2ui.grd_network.refresh()
    w2ui.grd_exfiltration.refresh()
    w2ui.grd_osint.refresh()
    w2ui.grd_systems.refresh()
    w2ui.grd_actions.refresh()
    w2ui.grd_casenotes.refresh()
    w2ui.grd_investigators.refresh()
    w2ui.grd_evidence.refresh()

    //TODO: Make case data editable
}
Change to gui to read only mode when the user does not have the lock