add allow and revoke tests and fixes