Sha256: 0e2ce333a144a3f52b7336a0bf01793a8eb21305e99ea5c40c3cbd428edd9bd8

Contents?: true

Size: 1.07 KB

Versions: 22

Compression:

Stored size: 1.07 KB

Contents

The **CanTango::Ability** is initialized with a candidate and an options
hash.

## Candidate

The candidate is any object that can have roles and/or role groups
behavior attached. A candidate is usually either user and in some cases
might be a user account.

## Options hash

When used from a web framework such as Rails, the options hash
is populated with essential objects such as:

* Request
* Session
* Params

These objects are then made available to the permission rules for evaluation.
Some rules might dependen on whether the user is accessing the site
from localhost or if the user has a given session state.

## The Flow

1. Use cached rules if available for user
2. Generate rules for user
3. Cache rules for user

### Use cache rules

See [[Rules cache]]

### Generate rules

1. Generate Permission rules from store
2. Generate Permit rules from classes

### Cache rules

Generate a unique hash key for the user and marshal all the rule in a
store with that key as identifier. If the user changes, the rules
for the old key will be invalidated and new rules generated for the new
key.


Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
cantango-0.9.4.7 wiki/ability/initialize.markdown
cantango-0.9.4.6 wiki/ability/initialize.markdown
cantango-0.9.4.5 wiki/ability/initialize.markdown
cantango-0.9.4.3 wiki/ability/initialize.markdown
cantango-0.9.4.2 wiki/ability/initialize.markdown
cantango-0.9.4.1 wiki/ability/initialize.markdown
cantango-0.9.4 wiki/ability/initialize.markdown
cantango-0.9.3.2 wiki/ability/initialize.markdown
cantango-0.8.9.5 wiki/ability/initialize.markdown
cantango-0.8.9.4 wiki/ability/initialize.markdown
cantango-0.8.9.3 wiki/ability/initialize.markdown
cantango-0.8.9.2 wiki/ability/initialize.markdown
cantango-0.8.9.1 wiki/ability/initialize.markdown
cantango-0.8.9 wiki/ability/initialize.markdown
cantango-0.8.8.1 wiki/ability/initialize.markdown
cantango-0.8.8 wiki/ability/initialize.markdown
cantango-0.8.7 wiki/ability/initialize.markdown
cantango-0.8.6.2 wiki/ability/initialize.markdown
cantango-0.8.6.1 wiki/ability/initialize.markdown
cantango-0.8.6 wiki/ability/initialize.markdown