Skip to content

Commit

Permalink
Moved graphql scafolding
Browse files Browse the repository at this point in the history
  • Loading branch information
gorriecoe committed Oct 25, 2018
1 parent 61357bf commit ab809d7
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/models/MenuLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,21 @@ public function canDelete($member = null)
return $this->MenuSet()->canEdit($member);
}

/**
* DataObject create permissions
* @param Member $member
* @param array $context Additional context-specific data which might
* affect whether (or where) this object could be created.
* @return boolean
*/
public function canCreate($member = null, $context = [])
{
if (isset($context['Parent'])) {
return $context['Parent']->canEdit();
}
return $this->MenuSet()->canEdit();
}

public function provideGraphQLScaffolding(SchemaScaffolder $scaffolder)
{
$scaffolder->type(MenuLink::class)
Expand Down Expand Up @@ -204,19 +219,4 @@ public function provideGraphQLScaffolding(SchemaScaffolder $scaffolder)
->end();
return $scaffolder;
}

/**
* DataObject create permissions
* @param Member $member
* @param array $context Additional context-specific data which might
* affect whether (or where) this object could be created.
* @return boolean
*/
public function canCreate($member = null, $context = [])
{
if (isset($context['Parent'])) {
return $context['Parent']->canEdit();
}
return $this->MenuSet()->canEdit();
}
}

0 comments on commit ab809d7

Please sign in to comment.