canvas-lms/gems/adheres_to_policy
Tyler Pickett 465afda22f Add a flag to completely disable caching of permissions
Fixes: CNVS-38111

Test Plan:
* Disable permission caching
  `Setting.set('permissions_cache_enabled', 'false')`
* Start up your web server and visit any page
* You should not see any Redis requests for permissions in your
  development logs

Change-Id: Ib91a0b7fc9ca8db121f942984e26f44d19d2400b
Reviewed-on: https://gerrit.instructure.com/118850
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
Tested-by: Jenkins
2017-07-18 12:41:34 +00:00
..
lib Add a flag to completely disable caching of permissions 2017-07-18 12:41:34 +00:00
spec Add a flag to completely disable caching of permissions 2017-07-18 12:41:34 +00:00
.rspec convert adheres to policy plugin into proper gem 2014-01-31 17:22:45 +00:00
Gemfile bump simplecov, fixes SD-2056 2017-04-04 18:06:25 +00:00
README.md da licença part 53 2017-05-01 21:06:11 +00:00
Rakefile convert adheres to policy plugin into proper gem 2014-01-31 17:22:45 +00:00
adheres_to_policy.gemspec prep for Rails 5.1 2017-06-16 02:54:20 +00:00
test.sh simplify gem test harnesses 2016-01-19 17:52:58 +00:00

README.md

AdheresToPolicy

This allows us to do something like:

class Account < ActiveRecord::Base set_policy do given { |u| self.user == u } can :read and can :write end end

u = User.first a = Account.first a.check_policy(u)

License

Copyright (C) 2014 - present Instructure, Inc.

This file is part of Canvas.

Canvas is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License.

Canvas is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.