<commit_before># AccessGranted [![Build Status](https://travis-ci.org/chaps-io/access-granted.svg?branch=master)](https://travis-ci.org/chaps-io/access-granted) [![Code Climate](https://codeclimate.com/github/pokonski/access-granted.png)](https://codeclimate.com/github/pokonski/access-granted)

## [![](http://i.imgur.com/ya8Wnyl.png)](https://chaps.io) proudly made by [Chaps](https://chaps.io)


AccessGranted is a multi-role and whitelist based authorization gem for Rails. And it's lightweight (~300 lines of code)!


## Installation

Add the gem to your gemfile:

```ruby
gem 'access-granted', '~> 1.1.0'
```
Run the bundle command to install it. Then run the generator:

    rails generate access_granted:policy

Add the `policies` (and `roles` if you're using it to split up your roles into files) directories to your autoload paths in `application.rb`:
    
```ruby
config.autoload_paths += %W(#{config.root}/app/policies #{config.root}/app/roles)
```

### Supported Ruby versions

Because it has **zero** runtime dependencies it is guaranteed to work on all major Ruby versions MRI 1.9.3-2.5, Rubinius >= 2.X and JRuby >= 1.7.

## Summary

AccessGranted is meant as a replacement for CanCan to solve major problems:
<commit_msg>Remove 1.9.3 from the range<commit_after># AccessGranted [![Build Status](https://travis-ci.org/chaps-io/access-granted.svg?branch=master)](https://travis-ci.org/chaps-io/access-granted) [![Code Climate](https://codeclimate.com/github/pokonski/access-granted.png)](https://codeclimate.com/github/pokonski/access-granted)

## [![](http://i.imgur.com/ya8Wnyl.png)](https://chaps.io) proudly made by [Chaps](https://chaps.io)


AccessGranted is a multi-role and whitelist based authorization gem for Rails. And it's lightweight (~300 lines of code)!


## Installation

Add the gem to your gemfile:

```ruby
gem 'access-granted', '~> 1.1.0'
```
Run the bundle command to install it. Then run the generator:

    rails generate access_granted:policy

Add the `policies` (and `roles` if you're using it to split up your roles into files) directories to your autoload paths in `application.rb`:
    
```ruby
config.autoload_paths += %W(#{config.root}/app/policies #{config.root}/app/roles)
```

### Supported Ruby versions

Because it has **zero** runtime dependencies it is guaranteed to work on all major Ruby versions MRI `2.0` - `2.5`, Rubinius `>= 2.X` and JRuby `>= 1.7`.

## Summary

AccessGranted is meant as a replacement for CanCan to solve major problems:

{'fraction_non_alphanumeric': 0.144515612489992, 'fraction_numerical': 0.012810248198558846, 'mean_word_length': 4.653846153846154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7400133', 'n_tokens_mistral': 881, 'n_tokens_neox': 812, 'n_words': 245}