Fixed permission check