rarbac 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b27af0301b8f3c532aa0109fff3bec28f527d3f
4
- data.tar.gz: 859f26fabf0a378010d3ecc0f2674207deb3fb57
3
+ metadata.gz: ce43d1567a57a30f8b620d6e1170cf20f74dd7be
4
+ data.tar.gz: 5f0157aa6b2e5344afcbcfb4fc3b91e27cc79294
5
5
  SHA512:
6
- metadata.gz: e227b442d14f4f9a0941cae20ffc07cb8ec8761210cf121453744b68a33d87a095bc8e8f258b73c4948cf2b6b1a52aa4580ea4f4187299291556645dd8aedc34
7
- data.tar.gz: df61f081255dfed12d44deb4678bfa8de5a0c618e823a561e11e7e5218048857ce256af6773f7c37f2f6f427e0889ceb6abaaaf5194332096f660d68a1a63bdd
6
+ metadata.gz: 7cb575153cbfd401d280ce2f30952b31391dc269ca8062dd16c9416280c887ee2a1a3685b3a4da9d7621297522466c5c7be6537e4dfc66853f575b8b58335ca5
7
+ data.tar.gz: 791b13437baf4522404da91606ced01f6e92a168a0a1fc7cf15559255cb21809a8d20cb1d4319bfe0e26d50f7a6c56ff7647f6e25e1db74b559579ac825d7c95
data/README.md CHANGED
@@ -96,7 +96,9 @@ You may add `before_filter :ensure_permission!` to create role-based authorizati
96
96
  on the controller and action being executed. For example:
97
97
 
98
98
  ```ruby
99
- class PostsController < Rarbac::ApplicationController
99
+ class PostsController < ApplicationController::Base
100
+ include Rarbac::ApplicationHelper
101
+
100
102
  before_filter :ensure_permission!
101
103
 
102
104
  def show
@@ -33,9 +33,8 @@ module Rarbac
33
33
  # the result of the role check.
34
34
  def ensure_permission!(action=nil, &block)
35
35
  unless action
36
- # TODO: If not supplied an action, determine the controller name and
37
- # action being invoked, and use that to generate an appropriate action
38
- # name to check.
36
+ klass = self.class.name.underscore.sub("_controller", "")
37
+ action = "#{klass}##{action_name}"
39
38
  end
40
39
 
41
40
  has_something?(:has_permission?, action, block)
@@ -1,3 +1,3 @@
1
1
  module Rarbac
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rarbac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Margison