Sha256: 1781190fdb5ad356c65a44b24b7206cda970cd9a2b37d893386cc6bcf5c94f35

Contents?: true

Size: 725 Bytes

Versions: 1

Compression:

Stored size: 725 Bytes

Contents

# Stasi

A small authorization library inspired by CanCan

## Usage

```ruby
gem 'stasi'
```

In the model you wish to check permissions on, e.g. User :

```ruby
include Robotnik::Authorization::Watch
```

Then you can check permissions this way :

```ruby
user.can? :read, :posts
```

You define permissions in an initializer :

```ruby
Robotnik::Authorization::Law.define do
  
  status :admin do
    can read, :posts
    can :destroy, :posts
  end
  
  status :guest do
    can :read, :post
  end
  
end
```

Undefined permissions default to `false`.
`:admin` and `:guest`, in this example, must be methods on the `user` object.

## Milestones

* pass directly object, and not a symbol
* load specific permissions from db

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stasi-0.0.1.alpha README.md