Added more permissions and permission handling.