Tags: themasses/rails-authorization-plugin
Tags
Patch #8571 : Add type argument to is_role_of_what submitted by Aslak… … Hellesøy (aslak_hellesoy) In my RESTful index views for an AR type I often want to list all of the records *for a given type* for which the current user has the role "show". (As opposed to getting *any* record for which the user has the role) In order to achieve this, I have patched identity.rb so tht I can do this: def index if current_user.permit? 'admin' # show all projects @projects = Project.find(:all) else @projects = current_user.is_show_for_what(Project) end end
Patch #11352 : Fixes a bug with role_regex and simple quoted roles su… …bmitted by 'a French RoR developer' Documentation says: <role> ::= /\w+/ | /'.*'/ But this permission string isn't well parsed: " 'abcd:efgh' or 'abcd:ijkl' " You get an error because the role_regex defined in parser.rb eats every simple quote between the first and the last simple quote in the string. So I patched the two instances of role_regex in parser.rb, from this: role_regex = '\s*(\'\s*(.+)\s*\'|([A-Za-z]\w*))\s*' to this (the question mark ends the first pattern as soon as possible, avoiding the inner simple quotes to be eaten): role_regex = '\s*(\'\s*(.+?)\s*\'|([A-Za-z]\w*))\s*'
Patch #9431 : Fixes a bug in identity.rb submitted by Michel Martens … …(blaumag) If some authorizable instance accepts a role, then it responds true when queried for has_[role_name]? Example: country.has_kings? #=> false user.has_role "king", country country.has_kings? #=> true user.has_no_role "king", country country.has_kings? #=> true The last time, country.has_kings? should be false.
Patch #12170 : Additional HABTM options for acts_as_authorized_user A very simple patch that allows options to be passed to the has_and_belogs_to_many relationship. This seems necessary if the "User" object has a different name from the table name. has_and_belong_to_many does not automatically use the table set by the "User" object so it must be specified (along with the foreign key if applicable). Patch submitted by Eric Anderson (eric1234)
Fixes RubyForge bug #9368, Illegal chars in about.yml Bump version to 1.0.4 This fixes a bug where the ':' character in the about.yml description was causing the parsing of about.yml to fail. There was also a bad apostrophe char which was being escaped when the yaml file was parsed. You can now confirm that the about.yml parses in an 'irb' console with: require 'yaml' YAML.load(File.read('about.yml'))
Removed attr_protected from acts_as_authorized_user, acts_as_authoriz… …able methods. Using attr_protected is incompatible with the safer use of attr_accessible in models. Users are encouraged to specify the attr_accessible attributes of their models, all others will be protected by default, including attributes used by this plugin. Also did a dos2unix conversion of the CHANGELOG text file after updating it.
Modified db migration generator to create new Rails 2.x 'Sexy Migrati… …ons'
PreviousNext