/** * Overrides \RestfulEntityBase::checkPropertyAccess(). * * Allow user to create a label for the unsaved term, even if the user doesn't * have access to update existing terms, as required by the entity metadata * wrapper's access check. */ protected function checkPropertyAccess($op, $public_field_name, EntityMetadataWrapper $property, EntityMetadataWrapper $wrapper) { $info = $property->info(); $term = $wrapper->value(); if (!empty($info['name']) && $info['name'] == 'name' && empty($term->tid) && $op == 'edit') { return TRUE; } return parent::checkPropertyAccess($op, $public_field_name, $property, $wrapper); }