refact isPublishPermission for js call