Skip to content

Commit

Permalink
Fix exlcusion rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Carlino committed Oct 19, 2020
1 parent 23d3ed2 commit 68736db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion _config/graphql-legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Name: versioned-graphql
Only:
moduleexists: 'silverstripe/graphql'
classexists: 'SilverStripe\GraphQL\Manager'
Except:
classexists: 'SilverStripe\GraphQL\Schema\Schema'
---
SilverStripe\GraphQL\Scaffolding\Scaffolders\CRUD\Read:
extensions:
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQL/Resolvers/VersionedResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public static function resolvePublishOperation(array $context)
));
}
$permissionMethod = $isPublish ? 'canPublish' : 'canUnpublish';
if (!$this->$permissionMethod($obj, $context[QueryHandler::CURRENT_USER])) {
if (!$obj->$permissionMethod($context[QueryHandler::CURRENT_USER])) {
throw new Exception(sprintf(
'Not allowed to change published state of this %s',
$dataClass
Expand Down

0 comments on commit 68736db

Please sign in to comment.