Sha256: b0cfd0f856e629f143f0abb12b143b2393c2b73087722b20fff6588ee510502f

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

# StrongActions

Access control for rails controller/action.

## Installation

Add this line to your application's Gemfile:

    gem 'strong_actions'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install strong_actions

## Usage

Suppose method "current_user" is available for controllers and views,

and user has an attribute called admin and only admin can modify resource "users",

then prepare config/acl.yml

    current_user:
        users:
            new: admin?
            create: admin?
            edit: admin?
            update: admin?
            destroy: admin?

In views, use helper_method "available?"

    <%= link_to 'Add User' new_user_path if available?('users', 'new') %>

## Contributing

1. Fork it ( https://github.com/[my-github-username]/strong_actions/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
strong_actions-0.0.2 README.md