GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: A Ruby on Rails plugin that provides fine grained access control to RESTful resources in a Ruby on Rails 2.0+ project.
Homepage: http://blog.matt-darby.com/category/code-stuff/restful_acl/
Clone URL: git://github.com/mdarby/restful_acl.git
current_user should be a standard variable
mdarby (author)
Tue Aug 26 14:09:27 -0700 2008
commit  18d60b057256de57d409134690f8c81359abb748
tree    589297d96af8d82dd0ceb9a223b96e7f2560f790
parent  029e6406e3de259c62310a96746030e9087b1d49
...
3
4
5
6
 
7
8
9
...
11
12
13
14
 
15
16
17
...
19
20
21
22
 
23
24
25
...
27
28
29
30
 
31
32
33
34
35
36
 
37
38
39
...
3
4
5
 
6
7
8
9
...
11
12
13
 
14
15
16
17
...
19
20
21
 
22
23
24
25
...
27
28
29
 
30
31
32
33
34
35
 
36
37
38
39
0
@@ -3,7 +3,7 @@ module RestfulAclHelper
0
   def creatable
0
     return true if admin_enabled
0
     
0
- klass.is_creatable_by(@current_user)
0
+ klass.is_creatable_by(current_user)
0
   end
0
   alias_method :createable, :creatable
0
   
0
@@ -11,7 +11,7 @@ module RestfulAclHelper
0
   def updatable(object)
0
     return true if admin_enabled
0
     
0
- object.is_updatable_by(@current_user)
0
+ object.is_updatable_by(current_user)
0
   end
0
   alias_method :updateable, :updatable
0
   
0
@@ -19,7 +19,7 @@ module RestfulAclHelper
0
   def deletable(object)
0
     return true if admin_enabled
0
     
0
- object.is_deletable_by(@current_user)
0
+ object.is_deletable_by(current_user)
0
   end
0
   alias_method :deleteable, :deletable
0
   
0
@@ -27,13 +27,13 @@ module RestfulAclHelper
0
   def readable(object = nil)
0
     return true if admin_enabled
0
     
0
- klass.is_readable_by(@current_user, object)
0
+ klass.is_readable_by(current_user, object)
0
   end
0
 
0
   private
0
     
0
     def admin_enabled
0
- @current_user.respond_to?("is_admin?") && @current_user.is_admin?
0
+ current_user.respond_to?("is_admin?") && current_user.is_admin?
0
     end
0
     
0
     def klass

Comments

    No one has commented yet.