No commit activity in last 3 years
No release in over 3 years
Integration layer between Protector and Inherited Resources
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.3
>= 0

Runtime

 Project Readme

Protector::InheritedResources

Integrates Protector and Inherited Resources.

With this gem installed, Inherited Resources will automatically restrict collections and resources with current_user.

Installation

Add this line to your application's Gemfile:

gem 'protector-inherited_resources'

And then execute:

$ bundle

Example

No changes to controller code are required if current_user should be used to restrict models. However, if it's necessary to change that behavior, you can use protector_subject method:

class FoosController < InheritedResources::Base
  protector_subject :current_admin_user
  # or
  protector_subject { User.first }
  # or, to disable integration entirely,
  protector_subject false

Maintainers

  • Sergey Gridasov (@grindars)

License

It is free software, and may be redistributed under the terms of MIT license.