Initial draft of write authorization

Needs more tests and work around deployment / revocation,  but
contains the general idea.