Permalink
Browse files

this gem is obsolete

  • Loading branch information...
1 parent 1f81f36 commit 38cb390d849d6759025180a201655ec4bb1a7b2f @eval committed Mar 5, 2012
Showing with 6 additions and 78 deletions.
  1. +1 −0 PostInstall.txt
  2. +1 −76 README.md
  3. +4 −2 sudo_attr_accessibility.gemspec
View
@@ -0,0 +1 @@
+WARNING: This gem was renamed to su_attr_accessibility (see https://github.com/eval/su_attr_accessibility). Please update your dependencies!
View
@@ -1,78 +1,3 @@
# SudoAttrAccessibility
-Using attr_accessible you can explicitly define what attributes of a model can be assigned.
-As of Rails 3.1 this got even better as you can define different lists of attributes for different roles.
-
-While this is all good and fine to protect your models from malicious input from outside (handled mostly in controllers), it will also make other interactions with your models somewhat harder: e.g. when testing or when in the console you always have to pass a role which can access the correct attributes.
-
-This gem tries to solve this by letting you define roles that are allowed to access all attribites. It even makes it possible to forget all this role-stuff and only explicitly use roles in places where it matters (again: mostly in controllers).
-
-## Installation
-
-Add this line to your application's Gemfile:
-
- gem 'sudo_attr_accessibility'
-
-And then execute:
-
- $ bundle
-
-Or install it yourself as:
-
- $ gem install sudo_attr_accessibility
-
-## Usage
-
-```ruby
- class Person < ActiveRecord::Base
- belongs_to :account
-
- # attributes mass-assignable as role default
- attr_accessible :email
-
- # the admin-role can access all...
- sudo_attr_accessible_as :admin
-
- # ...even attributes defined later on
- attr_accessor :current_step
- end
-
- p1 = Person.new(:email => 'person1@example.org', :active => true)
- p1.email # => 'person1@example.org'
- p1.active # => nil
- p2 = Person.new({:email => 'person1@example.org', :active => true,
- :account => Account.first, :current_step => 1},
- :as => :admin)
- p2.email # => 'person1@example.org'
- p2.active # => true
- p2.current_step # => 2
- p2.account # => <Account ...>
-```
-
-Alternatively the default-role is passed to sudo_attr_accessible_as and
-another role is used for attr_accessible. This is more convenient when
-working in the console for example (no ':as => :role' is needed) though
-is less secure of course.
-
-Enabling this behaviour by default for all subclasses of AR:
-
-```ruby
- class ActiveRecord::Base
- def self.inherited(child_class)
- child_class.class_eval{ sudo_attr_accessible_as :default }
- super
- end
- end
-```
-
-## Contributing
-
-1. Fork it
-2. Create your feature branch (`git checkout -b my-new-feature`)
-3. Commit your changes (`git commit -am 'Added some feature'`)
-4. Push to the branch (`git push origin my-new-feature`)
-5. Create new Pull Request
-
-## Author
-
-Gert Goet (eval) :: gert@thinkcreate.nl :: @gertgoet
+This gem is renamed to su_attr_accessibility. See https://github.com/eval/su_attr_accessibility
@@ -4,10 +4,11 @@ require File.expand_path('../lib/sudo_attr_accessibility/version', __FILE__)
Gem::Specification.new do |gem|
gem.authors = ["Gert Goet"]
gem.email = ["gert@thinkcreate.nl"]
- gem.description = %q{Make all attributes of an AR-model accessible to some roles}
- gem.summary = %q{Make all attributes of an AR-model accessible to some roles}
+ gem.description = %q{See su_attr_accessibility}
+ gem.summary = %q{See su_attr_accessibility}
gem.homepage = "https://github.com/eval/sudo_attr_accessibility"
gem.license = "MIT"
+ gem.post_install_message = "PostInstall.txt"
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
gem.files = `git ls-files`.split("\n")
@@ -19,6 +20,7 @@ Gem::Specification.new do |gem|
gem.add_dependency "activesupport", ">= 3.0.0"
gem.add_dependency "activemodel", ">= 3.0.0"
+ gem.add_dependency "su_attr_accessibility", ">= 0.5.0"
gem.add_development_dependency "rspec", "~> 2.7.0"
gem.add_development_dependency "ZenTest", "~> 4.6.2"

0 comments on commit 38cb390

Please sign in to comment.