Skip to content
This repository has been archived by the owner on Aug 9, 2020. It is now read-only.

SerafimArts/railt-authorization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Railt Authorization

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!):

  1. Is only available to an authenticated user.
  2. Should pass the authorization gate defined in role argument.
type Example {
    field: Result! @can(role: "some")
}

Releases

No releases published

Packages

No packages published

Languages