fixed inverted return in hasWritePermissions