{"repo":"palkan/action_policy-graphql","free":true,"listed":false,"github":"https://github.com/palkan/action_policy-graphql","clone":"git clone https://github.com/palkan/action_policy-graphql.git","description":"Action Policy integration for GraphQL","language":"Ruby","stars":149,"topics":["ruby","authorization","graphql","hacktoberfest"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"Action Policy GraphQL This gem provides an integration for using Action Policy as an authorization framework for GraphQL applications (built with graphql ruby gem). This integration includes the following features: - Fields & mutations authorization - List and connections scoping - Exposing permissions/authorization rules in the API . 📑 Documentation Action Policy GraphQL is built by Evil Martians , an American design and engineering consultancy for developer tools, AI, and cybersecurity startups . Installation Add this line to your application's Gemfile: Usage NOTE: this is a quick overview of the functionality provided by the gem. For more information see the documentation. To start using Action Policy in GraphQL-related code, you need to enhance your base classes with ActionPolicy::GraphQL::Behaviour : authorize: You can add authorization to the fields by specifying the authorize: option: The code above is equal to: You can customize the authorization options, e.g. authorize: {to: :preview?, with: CustomPolicy} . If you don't want to raise an exception but return a null instead, you should set a raise: false option. Note: it does not make too much sense to use authorize in mutations since it's checking authorization rules after mutation is executed. Therefore authorize marked as deprecated when used in mutations and will raise error in future releases. authorized scope: You can add authorized scope: true option to the field (list or connection field) to apply the correspo","default_branch":null,"files":null,"tree":[],"storefront":"/r/palkan","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/palkan/action_policy-graphql/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}