Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: ryanb/cancan
base: 1.3.0
...
head fork: ryanb/cancan
compare: 1.5.0
Commits on Aug 07, 2010
@ryanb fixing error on protected sanitize_sql - closes #111 f8631dc
@ryanb releasing version 1.3.1 with sanitize_sql fix cd74267
@ryanb properly pass along resource name without slice error - closes #112 333ddf1
@ryanb releasing version 1.3.2 which fixes slice error when passing custom r…
…esource name
a566ea0
Commits on Aug 17, 2010
@mlooney mlooney fix for bug 123 3d7742e
Commits on Aug 18, 2010
@ryanb fixing broken spec and minor improvements to tableized_conditions method e893e12
@ryanb use RSpec namespace for matcher - closes #119 caed4fc
Commits on Aug 20, 2010
@ryanb releasing version 1.3.3 a10a38c
Commits on Aug 30, 2010
@ryanb be more clear about blocks not working with accessible_by - closes #130 4fe44af
@ryanb don't stop at cannot definition when checking class - closes #131 5a353c1
Commits on Aug 31, 2010
@ryanb releasing version 1.3.4 04b523e
Commits on Sep 02, 2010
@ryanb skip block when only class is passed to ability check, also don't pas…
…s class to block for :all - closes #116
6105edc
@ryanb don't pass action into can block with :manage option - closes #129 b1fb179
@ryanb support no arguments to 'can' definition which always calls block 66314a8
Commits on Sep 03, 2010
@ryanb use I18n for unauthorization messages - closes #103 a5f838a
@ryanb make it clear in readme that alias_action is an instance method - clo…
…ses #139
737f8ac
@ryanb passing a hash to can? will check permissions on association, this is…
… done automatically in authorize_resource - closes #121
c88cb8f
@ryanb don't fail if association conditions aren't specified for nested asso…
…ciation check
1be5bf7
@ryanb the new and create actions will now build the resource with attribute…
…s based on ability conditions hash - closes #114
a744377
@ryanb cleaning up some internal specs and names 721939b
@ryanb have params hash override initial attributes when building a new reso…
…urce
7c52433
@ryanb adding check_authorization and skip_authorization controller class me…
…thods to ensure authorization is triggered (thanks justinko) - closes #135
1af6c6f
@ryanb filling in some inline documentation for 1.4 bf9b8ad
Commits on Sep 07, 2010
@ryanb adding action and subject variables to I18n unauthorized message - cl…
…oses #142
158c908
@ryanb load the collection instance variable on index action - closes #137 9d91545
Commits on Sep 08, 2010
@ryanb fix pluralize error on index action when passing resource name - closes
#143 again
a5ff826
Commits on Sep 09, 2010
@ryanb adding support for loading through Inherited Resources - closes #23 4eee637
Commits on Sep 16, 2010
@jbarreneche jbarreneche Controllers which use 'inherit_resources' instead of Inheritance may …
…have inherited_resource's methods protected
961df90
@jbarreneche jbarreneche Use cancan_resource_class for before filters instead of hardcoded Con…
…trollerResource class
0b270f2
@funny-falcon funny-falcon resolve issue 149 f236b1b
@funny-falcon funny-falcon allow to check ability by common module e2c341b
@funny-falcon funny-falcon fix error a0f73fe
@funny-falcon funny-falcon add specs for module definitions ff9a917
@funny-falcon funny-falcon add specs to sql conditions by not Hash 7e0e722
@ryanb fetch cancan_resource_class through controller class from ControllerR…
…esource
cef55c9
Commits on Sep 20, 2010
@funny-falcon funny-falcon consistency addition for ability check on Module ebef3cc
Commits on Sep 21, 2010
@ryanb raise AccessDenied error when loading child while parent is nil, pass…
… :shallow => true to bypass
264e2d2
@ryanb support loading resource :through method along with instance variable…
… - closes #146
c11ffb6
@ryanb adding to changelog 3391c5a
Commits on Sep 23, 2010
@ryanb use 'send' to access controller current_ability in case it's private 1f81b8d
Commits on Oct 04, 2010
@funny-falcon funny-falcon should not allow to can? when raw sql without block is present 12037d7
@ryanb don't stop at cannot definitions when there are no conditions - closes 8f49f28
Commits on Oct 05, 2010
@ryanb adding Gemfile, to get specs running just bundle and rake - closes #163 18b45d5
@ryanb adding a couple things to the changelog b0cec52
@ryanb looks like Bundler automatically requires cancan for the specs fa766e7
@ryanb updating readme and documentation 6c3e87e
@ryanb releasing version 1.4.0 67cd83d
Commits on Oct 08, 2010
@ryanb using supermodel in specs to remove some of the model stubs f901c36
Commits on Oct 13, 2010
@bowsersenior bowsersenior Add support for Mongoid documents along with basic specs. be74df0
@bowsersenior bowsersenior Add support for Mongoid::Criteria Symbol extensions (:age.gt => 10) a…
…long with specs.
ab82dcb
Commits on Oct 14, 2010
@bowsersenior bowsersenior Fix accessible_by for Mongoid documents when no ability is defined.
The previous spec that checked for this was not right, since there were no documents in the collection, so every query would return an empty result.
25bf479
Commits on Oct 15, 2010
@bowsersenior bowsersenior Fix bug with CanDefinition#tableized_conditions being used with Mongo…
…id documents and add more specs for accesible_by with Mongoid.
d256aeb
@bowsersenior bowsersenior Fix bug with Mongoid document where :manage :all caused accessible_by…
… to return nothing and add specs to test for :manage :all.
dbcd93e
Commits on Nov 12, 2010
@mphalliday mphalliday This fixes an odd error I was seeing in development mode when cache_c…
…lasses = false (the default), specifically when loading an object throught the parent in load_and_authorize_resource.

Assume Photo model and User model where user has many photos:

@photo = current_user.photos.find(1) # this returns a photo
@photo1 = Photo.find(1)

@photo.kind_of?(Photo) is not always true for some reason when class_cacheing is false.  Where as @photo1.kind_of?(Photo) always appears to be true.  Of interesting note, in the above example @photo != @photo1 if kind_of? is false.  Very odd.
 
Again, this only appears to be when loading and object through an association.
79180de
@ramontayag ramontayag checks if active record responds to 'joins', so this can work with in…
…ternuity's quick_scopes gem; added .swp files to git ignore
cf263c1
@nandalopes nandalopes Fix NoMethodError
Raises NoMethodError when using ":singleton => true, :shallow => true" and parent_resource is nil
9a7c427
@ryanb fixing specs due to joins method check in active record additions ebf77ed
@ryanb adding :through_association option to load_resource (thanks hunterae)…
… - closes #171
92995d7
@ryanb renaming skip_authorization to skip_authorization_check - closes #169 787511a
@ryanb releasing version 1.4.1 872e4cf
Commits on Nov 16, 2010
@tylergannon tylergannon can? should only go to db if there are mongoid criteria in the condit…
…ions.

Easier to just do a simple comparison on the object in memory
than to search the database.  Also this allows method calls
and other attributes that might not be found in the database.
f6aaa58
@bowsersenior bowsersenior Update specs for MongoidAdditions to use rr mocks 5ebca1f
Commits on Nov 17, 2010
@bowsersenior bowsersenior Add comments clarifying `alias_method` in MongoidAdditions 84c590e
@bowsersenior bowsersenior Remove commented-out line from gemspec 2ee6908
Commits on Dec 21, 2010
@ryanb Merge branch 'master' of https://github.com/bowsersenior/cancan into …
…bowsersenior-master
a6959c0
@ryanb renaming CanDefinition to Rule 37c1491
@ryanb adding ability generator - closes #170 9b8e849
@ryanb allow query.conditions to be called multiple times without losing con…
…ditions
5e1e6e1
@ryanb improve support for rspec scaffolding (thanks voxik) - closes #176 4339ac6
Commits on Dec 26, 2010
@bowsersenior bowsersenior Rename Mongoid collection used in spec and fix description for first …
…spec
ebb8e1b
@bowsersenior bowsersenior Fix bug with MongoidAdditions throwing a NameError when Mongoid is no…
…t defined by always checking if Mongoid is defined before referencing Mongoid-related constants

Also add spec for this bug
e14e1ed
Commits on Dec 28, 2010
@ryanb switching gemspec version to 1.5.0.beta1 to avoid confusion 2d31cbd
Commits on Dec 29, 2010
@natemueller natemueller Add support and tests for datamapper.
This broke some of the mongoid tests and I don't know how to fix them.  Both packages
  define Symbol#in, and when you load them both things don't behave properly.  Hopefully
  someone more versed in mongoid can rewrite the spec to not depend on the Symbol extensions.
d315e22
@ryanb adding .rvmrc file to switch to Ruby 1.8.7 for development 5183113
@ryanb moving model adapter specs into their own directory with MODEL_ADAPTE…
…R environment variable for choosing which one to run
f9a498d
@ryanb move mongoid/dm gems into Gemfile and load dynamically based on MODEL…
…_ADAPTER env variable
2dc2a57
@ryanb adding some documentation for running specs with different model adap…
…ters
f8760b7
@ryanb adding model adapter files in proper location with loading behavior 4c5ba09
Commits on Dec 30, 2010
@ryanb adding initial active record adapter af9e77a
@ryanb fixing active record adapter behavior and improving specs for it cc30e83
@ryanb dynamically detect which model adapter to use given a class bbb02f7
@ryanb cleanup whitespace 8628aa0
@ryanb removing fake sanitize methods in specs because we're using Active Re…
…cord now
e8d298c
@ryanb switching data mapper to new adapter f5dce44
@ryanb switching mongoid over to new adapter f7a494d
@ryanb moving accessible_by out into ModelAdditions module ec616ae
@ryanb removing Mongoid::Components hack, tests are passing without it, add …
…tests if this is actually needed
fc867c9
@ryanb removing query.rb since it is no longer used f9f71d6
@ryanb adding spec_all task for running specs for all model adapters 70b5f9a
@ryanb adding spec_all rake task to spec readme 6ccb4dd
Commits on Jan 03, 2011
@bowsersenior bowsersenior Automatically add `accessible_by` to Mongoid Documents to match CanCa…
…n behavior for ActiveRecord and DataMapper.

Previously, CanCan::ModelAdditions had to be included in each and every Mongoid document separately. Also removed manual include of CanCan::ModelAdditions from Mongoid documents in Mongoid adapter specs.
f759ab7
Commits on Jan 04, 2011
@ryanb removing unused sanitization code in mongoid spec bd9480c
@ryanb moving with_model rspec configuration into Active Record model adapte…
…r spec
685e926
@ryanb allow model adapter to override condition hash matching in Rule, also…
… clean up Mongoid adapter and specs
cef6c21
Commits on Jan 05, 2011
@ryanb improving DataMapper adapter and specs 15ca8ad
@ryanb don't authorize uncountable instance in collection action - closes #193 bc9ecb2
Commits on Jan 06, 2011
@bowsersenior bowsersenior Use `Mongoid::Matchers#matches?` instead of a database query in `Mong…
…oidAdapter#matches_conditions_hash?`
12b0bff
@bowsersenior bowsersenior Add MongoidAdapter specs for unsaved instances 9a14c70
Commits on Jan 07, 2011
@ryanb use gemset in rvmrc (thanks bowsersenior) - closes #231 045a850
@ryanb Merge branch 'bowsersenior-master' 71ceb83
Commits on Jan 08, 2011
@ryanb adding skip load and authorize behavior - closes #164 5732711
@ryanb moving parts of the README into wiki pages e2910a7
@ryanb updating changelog 3885f46
@ryanb fixing github links in readme 39bffe9
Commits on Jan 09, 2011
@ryanb fixing link in readme e49190f
Commits on Jan 11, 2011
@ryanb updating readme for 1.5 120eafe
@ryanb releasing 1.5.0 04522c9