The Meaning of Life, the Universe, and Everything.
You can create a chest that has its slots constantly filled with items, but make sure the items have special tags. Then you can have a repeating command block that clears the entire player's inventory from those items with that tag.
Make sure that in the /clear command the item specified is completely matching the one in the chest or it won't work.
You cant make someone able to "edit" without creating something like in the attached image (if you want I can upload a schematic of it, though it doesn't have a "view only" option) but you can make it able to be taken out by someone with a certain tag:
/Execute as @a[distance=..20] unless entity @s[tag=<tag>] run clear @s <item>