restful_acl 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +6 -2
- data/VERSION +1 -1
- data/lib/restful_acl.rb +1 -0
- data/lib/restful_acl/railtie.rb +27 -13
- data/restful_acl.gemspec +1 -1
- metadata +3 -3
data/README.markdown
CHANGED
@@ -2,6 +2,10 @@ RESTful_ACL
|
|
2
2
|
===========
|
3
3
|
RESTful_ACL is a full-stack context-based permission engine. It provides access control that is contextually aware. (If a parent is closed, a child is not editable, etc.) Permission is as simple as true or false.
|
4
4
|
|
5
|
+
Rails 3
|
6
|
+
-------
|
7
|
+
RESTful_ACL 3.1 and on are Rails 3 ready. Rails 2 will no longer be supported. Sorries.
|
8
|
+
|
5
9
|
Requirements
|
6
10
|
------------
|
7
11
|
RESTful_ACL requires the notion of a `current_user`. Most authenticaion plugins provide this (AuthLogic, RESTful_Authentication, etc.)
|
@@ -11,8 +15,8 @@ How to Install
|
|
11
15
|
Install the RESTful_ACL gem:
|
12
16
|
<pre><code>sudo gem install restful_acl -s http://gemcutter.org</code></pre>
|
13
17
|
|
14
|
-
Add the gem to your
|
15
|
-
<pre><code>
|
18
|
+
Add the gem to your Gemfile file as thus:
|
19
|
+
<pre><code>gem "restful_acl"</code></pre>
|
16
20
|
|
17
21
|
RESTful_ACL requires a named route named "denied". Add the following to your routes.rb file:
|
18
22
|
<pre><code>map.denied 'denied', :controller => 'some_controller', :action => 'denied_action'</code></pre>
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.2
|
data/lib/restful_acl.rb
CHANGED
data/lib/restful_acl/railtie.rb
CHANGED
@@ -1,19 +1,33 @@
|
|
1
|
+
# require 'restful_acl'
|
2
|
+
#
|
3
|
+
# module RestfulAcl
|
4
|
+
# if defined? Rails::Railtie
|
5
|
+
# require 'rails'
|
6
|
+
# class Railtie < Rails::Railtie
|
7
|
+
# initializer 'restful_acl.insert_into_active_record' do
|
8
|
+
# ActiveSupport.on_load :active_record do
|
9
|
+
# RestfulAcl::Railtie.insert
|
10
|
+
# end
|
11
|
+
# end
|
12
|
+
# end
|
13
|
+
# end
|
14
|
+
#
|
15
|
+
# class Railtie
|
16
|
+
# def self.insert
|
17
|
+
# ActiveRecord::Base.send(:include, RestfulAcl::Model)
|
18
|
+
# ActionController::Base.send(:include, RestfulAcl::Controller)
|
19
|
+
# ActionView::Base.send(:include, RestfulAcl::Helper)
|
20
|
+
# end
|
21
|
+
# end
|
22
|
+
# end
|
23
|
+
|
24
|
+
|
1
25
|
require 'restful_acl'
|
26
|
+
require 'rails'
|
2
27
|
|
3
28
|
module RestfulAcl
|
4
|
-
|
5
|
-
|
6
|
-
class Railtie < Rails::Railtie
|
7
|
-
initializer 'restful_acl.insert_into_active_record' do
|
8
|
-
ActiveSupport.on_load :active_record do
|
9
|
-
RestfulAcl::Railtie.insert
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
class Railtie
|
16
|
-
def self.insert
|
29
|
+
class Railtie < Rails::Railtie
|
30
|
+
initializer 'restful_acl.insert' do
|
17
31
|
ActiveRecord::Base.send(:include, RestfulAcl::Model)
|
18
32
|
ActionController::Base.send(:include, RestfulAcl::Controller)
|
19
33
|
ActionView::Base.send(:include, RestfulAcl::Helper)
|
data/restful_acl.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restful_acl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 3.1.
|
9
|
+
- 2
|
10
|
+
version: 3.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Darby
|