Skip to content

Commit

Permalink
Merge pull request #126 from moufmouf/improving_rights_doc
Browse files Browse the repository at this point in the history
Improving authentication management documentation
  • Loading branch information
moufmouf committed Aug 26, 2019
2 parents 182b577 + 2886d4b commit 26ed31d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/authentication_authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,14 @@ interface AuthorizationServiceInterface
public function isAllowed(string $right): bool;
}
```

You need to write classes that implement these interfaces. Then, you must register those classes with GraphQLite.
It you are [using the `SchemaFactory`](other-frameworks.md), you can register your classes using:

```php
// Configure an authentication service (to resolve the @Logged annotations).
$schemaFactory->setAuthenticationService($myAuthenticationService);
// Configure an authorization service (to resolve the @Right annotations).
$schemaFactory->setAuthorizationService($myAuthorizationService);
```

1 change: 0 additions & 1 deletion tests/Fixtures/Mocks/MockResolvableInputObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use GraphQL\Type\Definition\InputObjectType;
use GraphQL\Type\Definition\ResolveInfo;
use LogicException;
use function parent;
use TheCodingMachine\GraphQLite\Types\ResolvableMutableInputInterface;

class MockResolvableInputObjectType extends InputObjectType implements ResolvableMutableInputInterface
Expand Down

0 comments on commit 26ed31d

Please sign in to comment.