public
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
Search Repo:
Refactored the way the controller name is found
Thanks to Devon at kuxuesoft.com!
mdarby (author)
Wed Apr 02 05:42:25 -0700 2008
commit  238c335d31ea24675859a59f601d82f78e61d938
tree    1e86a5632f0171049982dfe3a2e5f50b2408d47f
parent  f1b00fa2dd23ebc5f70ceffb20f0046b3286c622
...
9
10
11
12
13
14
 
 
 
15
16
17
...
49
50
51
52
53
 
...
9
10
11
 
 
 
12
13
14
15
16
17
...
49
50
51
 
52
53
0
@@ -9,9 +9,9 @@ module RestfulAcl
0
     
0
     def has_permission?
0
       begin
0
- # Load the Model based on the controller name passed in
0
- klass = params[:controller].classify.constantize
0
-
0
+ # Load the Model based on the controller name
0
+ klass = self.controller_name.classify.constantize
0
+
0
         # Load the object requested if the param[:id] exists
0
         object = klass.find(params[:id]) unless params[:id].blank?
0
       
0
@@ -49,4 +49,4 @@ module RestfulAcl
0
     end
0
   
0
   end
0
-end
0
\ No newline at end of file
0
+end

Comments

    No one has commented yet.