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

public
Description: This plugin provides a flexible way to add authorization to Rails.
Homepage: http://www.writertopia.com/developers/authorization
Clone URL: git://github.com/DocSavage/rails-authorization-plugin.git
Patch to allow authorizable objects that use single table inheritance 
(STI) [Sean Geoghegan]

git-svn-id: http://svn.writertopia.com/svn/plugins/authorization@80 
ab2ce248-d915-0410-80fa-b7cb84e05f00
bkatz (author)
Sat Sep 16 17:40:17 -0700 2006
commit  5378fe14beb272759d8fea0bd0cc608cc90ef0aa
tree    446b0fb36dd29fbbe4b113b4bf56087df9f71c71
parent  3765c280128c3f539c61dc39c748cf1f84858d38
...
8
9
10
 
 
11
12
13
...
8
9
10
11
12
13
14
15
0
@@ -8,6 +8,8 @@ TO DO
0
 
0
 CHANGES (from most recent to oldest)
0
 
0
+* Patch to allow authorizable objects that use single table inheritance (STI) [Sean Geoghegan]
0
+
0
 === 1.0 release (Sept 13, 2006)
0
 
0
 * Added attr_protected for habtm and has_many role ids to block security concern if developers use update_attributes(params[:auth_obj]) on an authorizable object [Michael Schuerig]
...
60
61
62
63
 
64
65
66
...
60
61
62
 
63
64
65
66
0
@@ -60,7 +60,7 @@ module Authorization
0
           elsif authorizable_obj
0
             Role.find( :first,
0
                        :conditions => [ 'name = ? and authorizable_type = ? and authorizable_id = ?',
0
- role_name, authorizable_obj.class.to_s, authorizable_obj.id ] )
0
+ role_name, authorizable_obj.class.base_class.to_s, authorizable_obj.id ] )
0
           else
0
             Role.find( :first,
0
                        :conditions => [ 'name = ? and authorizable_type IS NULL and authorizable_id IS NULL', role_name ] )

Comments

    No one has commented yet.