The
policy of a
bag is set or edited when editing a bag either via
twanager or using the
HTTP API.
The
bag command of twanager takes a bag name as an argument and an optional JSON string representing a
policy:
twanager bag foobar
{"policy": {"read":["someusername"]}}
^D
PUT to
/bags/{bag_name} is much the same: the JSON representation must include a policy element.
In either case, if the bag already exists, the bag's current policy is clobbered by the new one provided.