def clear_temp_permissions():
    """
    Clear temporary permissions (one-time and session) from the permissions file.
    """
    permissions = read_permissions_from_file()
    for user_id in permissions:
        for app in list(permissions[user_id]):
            for perm_category in list(permissions[user_id][app]):
                if not permissions[user_id][app][perm_category]:
                    del permissions[user_id][app][perm_category]
                elif permissions[user_id][app][perm_category] in PermissionType.SESSION:
                    del permissions[user_id][app][perm_category]
    write_permissions_to_file(permissions)

    Clear temporary permissions (one-time and session) from the permissions file.
    
llama-index-packs/llama-index-packs-secgpt/llama_index/packs/secgpt/permission.py