Refactor calendar permissions and added event tests