Created initial file and added a permission check function