RubyGems Navigation menu

cant 0.2.0

include Cant ------------ class User; include Cant::Embeddable; end class AuthorizationMiddleware; include Cant::Embeddable; end declare rules ------------- User.cant do |action=:update, post| not post.user == self if Post === resource and action == :update end AuthorizationMiddleware.cant do |env| not env['user'] == env['post'].user if env.path =~ /^\posts/ and env.method == 'PUT' end verify ------ user.cant? :update, post user.die_if_cant! :update, post control ------- rescue_from Cant::AccessDenied do |error| flash[:error] = error.message redirect_to request.referer end

Gemfile:
= Copy to clipboard Copied!

install:
=

Versions:

  1. 0.2.2 - January 14, 2011 (11.5 KB)
  2. 0.2.1 - January 04, 2011 (11.5 KB)
  3. 0.2.0 - January 03, 2011 (12 KB)

Development Dependencies (2):

rspec >= 0
wrong >= 0

Owners:

Authors:

  • thierry.henrio

SHA 256 checksum:

4ac4289d1e7c58eed7e99fa50ef07e93b139067bcfadf70d348dfb1e39785382

Total downloads 13,687

For this version 4,240

Licenses:

N/A

Required Ruby Version: None

Links: