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


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


## Installation

    gem 'access-granted'

### Supported Ruby versions

Guaranteed to work on all major Ruby versions MRI 1.9.3-2.2, Rubinius >= 2.X and JRuby >= 1.7.

## Summary

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

1. Performance
  On average AccessGranted is 50-60% faster in resolving identical dependencies and takes less memory.
  See [benchmarks](https://github.com/chaps-io/access-granted/blob/master/benchmarks).

2. Built-in support for user roles

  Easy to read access policy code where permissions are cleanly grouped into roles.
  Additionally, permissions are forced to be unique in the scope of a role. This greatly simplifies resolving permissions and makes it faster.

3. white-list based

  This means that you define what the user **can** do, which results in clean, readable policies regardless of app complexity.
  You don't have to worry about juggling `can`s and `cannot`s in a very convoluted way!<commit_msg>Tweaks to README<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)


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


## Installation

    gem 'access-granted'

### Supported Ruby versions

Guaranteed to work on all major Ruby versions MRI 1.9.3-2.2, Rubinius >= 2.X and JRuby >= 1.7.

## Summary

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

1. Performance

  On average AccessGranted is 50-60% faster in resolving identical dependencies and takes less memory.
  See [benchmarks](https://github.com/chaps-io/access-granted/blob/master/benchmarks).

2. Roles

  Adds support for roles, so no more `if`s and `else`s in your Policy file. This makes it extremely easy to   
  maintain and read the code.

3. white-lists

  This means that you define what the user **can** do, which results in clean, readable policies regardless of app complexity.
  You don't have to worry about juggling `can`s and `cannot`s in a very convoluted way!
{'fraction_non_alphanumeric': 0.11372411372411373, 'fraction_numerical': 0.013338013338013339, 'mean_word_length': 4.387523629489603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 14, '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': '6898274', 'n_tokens_mistral': 935, 'n_tokens_neox': 864, 'n_words': 301}