serafim / railt-authorization
This package is abandoned and no longer maintained.
No replacement package was suggested.
Railt authorization extension for Laravel Framework
dev-master
2018-03-15 02:13 UTC
Requires
- php: >=7.1
- illuminate/auth: 5.*
- railt/railt: >=1.2|dev-master
This package is auto-updated.
Last update: 2020-09-07 06:52:13 UTC
README
Your application should use the Laravel Provider
Installation
composer require serafim/railt-authorization
- Add into
config/railt.php
:
... 'extensions' => [ \Serafim\RailtAuthorization\AuthorizationExtension::class, ]
Usage
Authenticated
The field that contains the directive @auth
is only available to an authenticated user.
type Example { field: Result! @auth }
Guest
The field that contains the directive @guest
is only available to a guest (non-authenticated user).
type Example { field: Result! @guest }
Authorization
The field that contains the directive @can(role: String!)
:
- Is only available to an authenticated user.
- Should pass the authorization gate defined in
role
argument.
type Example { field: Result! @can(role: "some") }