diff --git a/OrcidProfilePlugin.php b/OrcidProfilePlugin.php index ec27b7d1..5efab092 100755 --- a/OrcidProfilePlugin.php +++ b/OrcidProfilePlugin.php @@ -137,78 +137,42 @@ public function register($category, $path, $mainContextId = null) $schema->properties->orcidSandbox = (object)[ 'type' => 'string', - 'apiSummary' => true, + 'writeOnly' => 'true', 'validation' => ['nullable'] ]; $schema->properties->orcidAccessToken = (object)[ 'type' => 'string', - 'apiSummary' => true, + 'writeOnly' => 'true', 'validation' => ['nullable'] ]; $schema->properties->orcidAccessScope = (object)[ 'type' => 'string', - 'apiSummary' => true, + 'writeOnly' => 'true', 'validation' => ['nullable'] ]; $schema->properties->orcidRefreshToken = (object)[ 'type' => 'string', - 'apiSummary' => true, + 'writeOnly' => 'true', 'validation' => ['nullable'] ]; $schema->properties->orcidAccessExpiresOn = (object)[ 'type' => 'string', - 'apiSummary' => true, + 'writeOnly' => 'true', 'validation' => ['nullable'] ]; $schema->properties->orcidAccessDenied = (object)[ 'type' => 'string', - 'apiSummary' => true, + 'writeOnly' => 'true', 'validation' => ['nullable'] ]; $schema->properties->orcidEmailToken = (object)[ 'type' => 'string', - 'apiSummary' => true, + 'writeOnly' => 'true', 'validation' => ['nullable'] ]; $schema->properties->orcidWorkPutCode = (object)[ 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - }); - - // Add more ORCiD fields to user Schema - Hook::add('Schema::get::user', function ($hookName, $args) { - $schema = &$args[0]; - - $schema->properties->orcidAccessToken = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidAccessScope = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidRefreshToken = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidAccessExpiresOn = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidAccessDenied = (object)[ - 'type' => 'string', - 'apiSummary' => true, - 'validation' => ['nullable'] - ]; - $schema->properties->orcidReviewPutCode = (object)[ - 'type' => 'string', - 'apiSummary' => true, + 'writeOnly' => 'true', 'validation' => ['nullable'] ]; });