marnen-cancan 2.0.0.alpha.pre.f1cebde51a87be149b4970a3287826bb63c0ac0b
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/CHANGELOG.rdoc +381 -0
- data/Gemfile +3 -0
- data/LICENSE +20 -0
- data/README.rdoc +108 -0
- data/Rakefile +18 -0
- data/init.rb +1 -0
- data/lib/cancan.rb +13 -0
- data/lib/cancan/ability.rb +348 -0
- data/lib/cancan/controller_additions.rb +392 -0
- data/lib/cancan/controller_resource.rb +265 -0
- data/lib/cancan/exceptions.rb +53 -0
- data/lib/cancan/inherited_resource.rb +20 -0
- data/lib/cancan/matchers.rb +14 -0
- data/lib/cancan/model_adapters/abstract_adapter.rb +56 -0
- data/lib/cancan/model_adapters/active_record_adapter.rb +172 -0
- data/lib/cancan/model_adapters/data_mapper_adapter.rb +34 -0
- data/lib/cancan/model_adapters/default_adapter.rb +7 -0
- data/lib/cancan/model_adapters/mongoid_adapter.rb +54 -0
- data/lib/cancan/model_additions.rb +29 -0
- data/lib/cancan/rule.rb +178 -0
- data/lib/generators/cancan/ability/USAGE +5 -0
- data/lib/generators/cancan/ability/ability_generator.rb +16 -0
- data/lib/generators/cancan/ability/templates/ability.rb +24 -0
- data/lib/generators/cancan/ability/templates/ability_spec.rb +16 -0
- data/lib/generators/cancan/ability/templates/ability_test.rb +10 -0
- data/spec/README.rdoc +28 -0
- data/spec/cancan/ability_spec.rb +541 -0
- data/spec/cancan/controller_additions_spec.rb +118 -0
- data/spec/cancan/controller_resource_spec.rb +535 -0
- data/spec/cancan/exceptions_spec.rb +58 -0
- data/spec/cancan/inherited_resource_spec.rb +58 -0
- data/spec/cancan/matchers_spec.rb +33 -0
- data/spec/cancan/model_adapters/active_record_adapter_spec.rb +278 -0
- data/spec/cancan/model_adapters/data_mapper_adapter_spec.rb +120 -0
- data/spec/cancan/model_adapters/default_adapter_spec.rb +7 -0
- data/spec/cancan/model_adapters/mongoid_adapter_spec.rb +227 -0
- data/spec/cancan/rule_spec.rb +55 -0
- data/spec/matchers.rb +13 -0
- data/spec/spec_helper.rb +49 -0
- metadata +197 -0
@@ -0,0 +1,227 @@
|
|
1
|
+
if ENV["MODEL_ADAPTER"] == "mongoid"
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
class MongoidCategory
|
5
|
+
include Mongoid::Document
|
6
|
+
references_many :mongoid_projects
|
7
|
+
end
|
8
|
+
|
9
|
+
class MongoidProject
|
10
|
+
include Mongoid::Document
|
11
|
+
referenced_in :mongoid_category
|
12
|
+
end
|
13
|
+
|
14
|
+
Mongoid.configure do |config|
|
15
|
+
config.master = Mongo::Connection.new('127.0.0.1', 27017).db("cancan_mongoid_spec")
|
16
|
+
end
|
17
|
+
|
18
|
+
describe CanCan::ModelAdapters::MongoidAdapter do
|
19
|
+
context "Mongoid defined" do
|
20
|
+
before(:each) do
|
21
|
+
@ability = Object.new
|
22
|
+
@ability.extend(CanCan::Ability)
|
23
|
+
end
|
24
|
+
|
25
|
+
after(:each) do
|
26
|
+
Mongoid.master.collections.select do |collection|
|
27
|
+
collection.name !~ /system/
|
28
|
+
end.each(&:drop)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "is for only Mongoid classes" do
|
32
|
+
CanCan::ModelAdapters::MongoidAdapter.should_not be_for_class(Object)
|
33
|
+
CanCan::ModelAdapters::MongoidAdapter.should be_for_class(MongoidProject)
|
34
|
+
CanCan::ModelAdapters::AbstractAdapter.adapter_class(MongoidProject).should == CanCan::ModelAdapters::MongoidAdapter
|
35
|
+
end
|
36
|
+
|
37
|
+
it "finds record" do
|
38
|
+
project = MongoidProject.create
|
39
|
+
CanCan::ModelAdapters::MongoidAdapter.find(MongoidProject, project.id).should == project
|
40
|
+
end
|
41
|
+
|
42
|
+
it "compares properties on mongoid documents with the conditions hash" do
|
43
|
+
model = MongoidProject.new
|
44
|
+
@ability.can :read, :mongoid_projects, :id => model.id
|
45
|
+
@ability.should be_able_to(:read, model)
|
46
|
+
end
|
47
|
+
|
48
|
+
it "is able to read hashes when field is array" do
|
49
|
+
one_to_three = MongoidProject.create(:numbers => ['one', 'two', 'three'])
|
50
|
+
two_to_five = MongoidProject.create(:numbers => ['two', 'three', 'four', 'five'])
|
51
|
+
|
52
|
+
@ability.can :foo, :mongoid_projects, :numbers => 'one'
|
53
|
+
@ability.should be_able_to(:foo, one_to_three)
|
54
|
+
@ability.should_not be_able_to(:foo, two_to_five)
|
55
|
+
end
|
56
|
+
|
57
|
+
it "returns [] when no ability is defined so no records are found" do
|
58
|
+
MongoidProject.create(:title => 'Sir')
|
59
|
+
MongoidProject.create(:title => 'Lord')
|
60
|
+
MongoidProject.create(:title => 'Dude')
|
61
|
+
|
62
|
+
MongoidProject.accessible_by(@ability, :read).entries.should == []
|
63
|
+
end
|
64
|
+
|
65
|
+
it "returns the correct records based on the defined ability" do
|
66
|
+
@ability.can :read, :mongoid_projects, :title => "Sir"
|
67
|
+
sir = MongoidProject.create(:title => 'Sir')
|
68
|
+
lord = MongoidProject.create(:title => 'Lord')
|
69
|
+
dude = MongoidProject.create(:title => 'Dude')
|
70
|
+
|
71
|
+
MongoidProject.accessible_by(@ability, :read).entries.should == [sir]
|
72
|
+
end
|
73
|
+
|
74
|
+
it "returns the correct records when a mix of can and cannot rules in defined ability" do
|
75
|
+
pending "TODO figure out why this isn't working"
|
76
|
+
@ability.can :manage, :mongoid_projects, :title => 'Sir'
|
77
|
+
@ability.cannot :destroy, :mongoid_projects
|
78
|
+
|
79
|
+
sir = MongoidProject.create(:title => 'Sir')
|
80
|
+
lord = MongoidProject.create(:title => 'Lord')
|
81
|
+
dude = MongoidProject.create(:title => 'Dude')
|
82
|
+
|
83
|
+
MongoidProject.accessible_by(@ability, :destroy).entries.should == [sir]
|
84
|
+
end
|
85
|
+
|
86
|
+
it "is able to mix empty conditions and hashes" do
|
87
|
+
pending "TODO figure out why this isn't working"
|
88
|
+
@ability.can :read, :mongoid_projects
|
89
|
+
@ability.can :read, :mongoid_projects, :title => 'Sir'
|
90
|
+
sir = MongoidProject.create(:title => 'Sir')
|
91
|
+
lord = MongoidProject.create(:title => 'Lord')
|
92
|
+
|
93
|
+
MongoidProject.accessible_by(@ability, :read).count.should == 2
|
94
|
+
end
|
95
|
+
|
96
|
+
it "returns everything when the defined ability is access all" do
|
97
|
+
@ability.can :access, :all
|
98
|
+
sir = MongoidProject.create(:title => 'Sir')
|
99
|
+
lord = MongoidProject.create(:title => 'Lord')
|
100
|
+
dude = MongoidProject.create(:title => 'Dude')
|
101
|
+
|
102
|
+
MongoidProject.accessible_by(@ability, :read).entries.should == [sir, lord, dude]
|
103
|
+
end
|
104
|
+
|
105
|
+
it "allows a scope for conditions" do
|
106
|
+
@ability.can :read, :mongoid_projects, MongoidProject.where(:title => 'Sir')
|
107
|
+
sir = MongoidProject.create(:title => 'Sir')
|
108
|
+
lord = MongoidProject.create(:title => 'Lord')
|
109
|
+
dude = MongoidProject.create(:title => 'Dude')
|
110
|
+
|
111
|
+
MongoidProject.accessible_by(@ability, :read).entries.should == [sir]
|
112
|
+
end
|
113
|
+
|
114
|
+
describe "Mongoid::Criteria where clause Symbol extensions using MongoDB expressions" do
|
115
|
+
it "handles :field.in" do
|
116
|
+
obj = MongoidProject.create(:title => 'Sir')
|
117
|
+
@ability.can :read, :mongoid_projects, :title.in => ["Sir", "Madam"]
|
118
|
+
@ability.can?(:read, obj).should == true
|
119
|
+
MongoidProject.accessible_by(@ability, :read).should == [obj]
|
120
|
+
|
121
|
+
obj2 = MongoidProject.create(:title => 'Lord')
|
122
|
+
@ability.can?(:read, obj2).should == false
|
123
|
+
end
|
124
|
+
|
125
|
+
describe "activates only when there are Criteria in the hash" do
|
126
|
+
it "Calls where on the model class when there are criteria" do
|
127
|
+
obj = MongoidProject.create(:title => 'Bird')
|
128
|
+
@conditions = {:title.nin => ["Fork", "Spoon"]}
|
129
|
+
|
130
|
+
@ability.can :read, :mongoid_projects, @conditions
|
131
|
+
@ability.should be_able_to(:read, obj)
|
132
|
+
end
|
133
|
+
it "Calls the base version if there are no mongoid criteria" do
|
134
|
+
obj = MongoidProject.new(:title => 'Bird')
|
135
|
+
@conditions = {:id => obj.id}
|
136
|
+
@ability.can :read, :mongoid_projects, @conditions
|
137
|
+
@ability.should be_able_to(:read, obj)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
it "handles :field.nin" do
|
142
|
+
obj = MongoidProject.create(:title => 'Sir')
|
143
|
+
@ability.can :read, :mongoid_projects, :title.nin => ["Lord", "Madam"]
|
144
|
+
@ability.can?(:read, obj).should == true
|
145
|
+
MongoidProject.accessible_by(@ability, :read).should == [obj]
|
146
|
+
|
147
|
+
obj2 = MongoidProject.create(:title => 'Lord')
|
148
|
+
@ability.can?(:read, obj2).should == false
|
149
|
+
end
|
150
|
+
|
151
|
+
it "handles :field.size" do
|
152
|
+
obj = MongoidProject.create(:titles => ['Palatin', 'Margrave'])
|
153
|
+
@ability.can :read, :mongoid_projects, :titles.size => 2
|
154
|
+
@ability.can?(:read, obj).should == true
|
155
|
+
MongoidProject.accessible_by(@ability, :read).should == [obj]
|
156
|
+
|
157
|
+
obj2 = MongoidProject.create(:titles => ['Palatin', 'Margrave', 'Marquis'])
|
158
|
+
@ability.can?(:read, obj2).should == false
|
159
|
+
end
|
160
|
+
|
161
|
+
it "handles :field.exists" do
|
162
|
+
obj = MongoidProject.create(:titles => ['Palatin', 'Margrave'])
|
163
|
+
@ability.can :read, :mongoid_projects, :titles.exists => true
|
164
|
+
@ability.can?(:read, obj).should == true
|
165
|
+
MongoidProject.accessible_by(@ability, :read).should == [obj]
|
166
|
+
|
167
|
+
obj2 = MongoidProject.create
|
168
|
+
@ability.can?(:read, obj2).should == false
|
169
|
+
end
|
170
|
+
|
171
|
+
it "handles :field.gt" do
|
172
|
+
obj = MongoidProject.create(:age => 50)
|
173
|
+
@ability.can :read, :mongoid_projects, :age.gt => 45
|
174
|
+
@ability.can?(:read, obj).should == true
|
175
|
+
MongoidProject.accessible_by(@ability, :read).should == [obj]
|
176
|
+
|
177
|
+
obj2 = MongoidProject.create(:age => 40)
|
178
|
+
@ability.can?(:read, obj2).should == false
|
179
|
+
end
|
180
|
+
|
181
|
+
it "handles instance not saved to database" do
|
182
|
+
obj = MongoidProject.new(:title => 'Sir')
|
183
|
+
@ability.can :read, :mongoid_projects, :title.in => ["Sir", "Madam"]
|
184
|
+
@ability.can?(:read, obj).should == true
|
185
|
+
|
186
|
+
# accessible_by only returns saved records
|
187
|
+
MongoidProject.accessible_by(@ability, :read).entries.should == []
|
188
|
+
|
189
|
+
obj2 = MongoidProject.new(:title => 'Lord')
|
190
|
+
@ability.can?(:read, obj2).should == false
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
it "calls where with matching ability conditions" do
|
195
|
+
obj = MongoidProject.create(:foo => {:bar => 1})
|
196
|
+
@ability.can :read, :mongoid_projects, :foo => {:bar => 1}
|
197
|
+
MongoidProject.accessible_by(@ability, :read).entries.first.should == obj
|
198
|
+
end
|
199
|
+
|
200
|
+
it "excludes from the result if set to cannot" do
|
201
|
+
obj = MongoidProject.create(:bar => 1)
|
202
|
+
obj2 = MongoidProject.create(:bar => 2)
|
203
|
+
@ability.can :read, :mongoid_projects
|
204
|
+
@ability.cannot :read, :mongoid_projects, :bar => 2
|
205
|
+
MongoidProject.accessible_by(@ability, :read).entries.should == [obj]
|
206
|
+
end
|
207
|
+
|
208
|
+
it "combines the rules" do
|
209
|
+
obj = MongoidProject.create(:bar => 1)
|
210
|
+
obj2 = MongoidProject.create(:bar => 2)
|
211
|
+
obj3 = MongoidProject.create(:bar => 3)
|
212
|
+
@ability.can :read, :mongoid_projects, :bar => 1
|
213
|
+
@ability.can :read, :mongoid_projects, :bar => 2
|
214
|
+
MongoidProject.accessible_by(@ability, :read).entries.should =~ [obj, obj2]
|
215
|
+
end
|
216
|
+
|
217
|
+
it "does not allow to fetch records when ability with just block present" do
|
218
|
+
@ability.can :read, :mongoid_projects do
|
219
|
+
false
|
220
|
+
end
|
221
|
+
lambda {
|
222
|
+
MongoidProject.accessible_by(@ability)
|
223
|
+
}.should raise_error(CanCan::Error)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "ostruct" # for OpenStruct below
|
3
|
+
|
4
|
+
# Most of Rule functionality is tested in Ability specs
|
5
|
+
describe CanCan::Rule do
|
6
|
+
before(:each) do
|
7
|
+
@conditions = {}
|
8
|
+
@rule = CanCan::Rule.new(true, :read, :integers, @conditions)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "returns no association joins if none exist" do
|
12
|
+
@rule.associations_hash.should == {}
|
13
|
+
end
|
14
|
+
|
15
|
+
it "returns no association for joins if just attributes" do
|
16
|
+
@conditions[:foo] = :bar
|
17
|
+
@rule.associations_hash.should == {}
|
18
|
+
end
|
19
|
+
|
20
|
+
it "returns single association for joins" do
|
21
|
+
@conditions[:foo] = {:bar => 1}
|
22
|
+
@rule.associations_hash.should == {:foo => {}}
|
23
|
+
end
|
24
|
+
|
25
|
+
it "returns multiple associations for joins" do
|
26
|
+
@conditions[:foo] = {:bar => 1}
|
27
|
+
@conditions[:test] = {1 => 2}
|
28
|
+
@rule.associations_hash.should == {:foo => {}, :test => {}}
|
29
|
+
end
|
30
|
+
|
31
|
+
it "returns nested associations for joins" do
|
32
|
+
@conditions[:foo] = {:bar => {1 => 2}}
|
33
|
+
@rule.associations_hash.should == {:foo => {:bar => {}}}
|
34
|
+
end
|
35
|
+
|
36
|
+
it "returns no association joins if conditions is nil" do
|
37
|
+
rule = CanCan::Rule.new(true, :read, :integers)
|
38
|
+
rule.associations_hash.should == {}
|
39
|
+
end
|
40
|
+
|
41
|
+
it "has higher specificity for attributes/conditions" do
|
42
|
+
CanCan::Rule.new(true, :read, :integers).specificity.should eq(1)
|
43
|
+
CanCan::Rule.new(true, :read, :integers, :foo => :bar).specificity.should eq(2)
|
44
|
+
CanCan::Rule.new(true, :read, :integers, :foo).specificity.should eq(2)
|
45
|
+
CanCan::Rule.new(false, :read, :integers).specificity.should eq(3)
|
46
|
+
CanCan::Rule.new(false, :read, :integers, :foo => :bar).specificity.should eq(4)
|
47
|
+
CanCan::Rule.new(false, :read, :integers, :foo).specificity.should eq(4)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should not be mergeable if conditions are not simple hashes" do
|
51
|
+
meta_where = OpenStruct.new(:name => 'metawhere', :column => 'test')
|
52
|
+
@conditions[meta_where] = :bar
|
53
|
+
@rule.should be_unmergeable
|
54
|
+
end
|
55
|
+
end
|
data/spec/matchers.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
RSpec::Matchers.define :orderlessly_match do |original_string|
|
2
|
+
match do |given_string|
|
3
|
+
original_string.split('').sort == given_string.split('').sort
|
4
|
+
end
|
5
|
+
|
6
|
+
failure_message_for_should do |given_string|
|
7
|
+
"expected \"#{given_string}\" to have the same characters as \"#{original_string}\""
|
8
|
+
end
|
9
|
+
|
10
|
+
failure_message_for_should_not do |given_string|
|
11
|
+
"expected \"#{given_string}\" not to have the same characters as \"#{original_string}\""
|
12
|
+
end
|
13
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
|
4
|
+
require "sqlite3"
|
5
|
+
require "active_record"
|
6
|
+
|
7
|
+
case ENV["MODEL_ADAPTER"]
|
8
|
+
when "data_mapper"
|
9
|
+
require "dm-core"
|
10
|
+
require "dm-sqlite-adapter"
|
11
|
+
require "dm-migrations"
|
12
|
+
when "mongoid"
|
13
|
+
require "mongoid"
|
14
|
+
end
|
15
|
+
|
16
|
+
require 'active_support/all'
|
17
|
+
require 'matchers'
|
18
|
+
require 'cancan'
|
19
|
+
require 'cancan/matchers'
|
20
|
+
|
21
|
+
RSpec.configure do |config|
|
22
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
23
|
+
config.filter_run :focus => true
|
24
|
+
config.run_all_when_everything_filtered = true
|
25
|
+
end
|
26
|
+
|
27
|
+
class Ability
|
28
|
+
include CanCan::Ability
|
29
|
+
|
30
|
+
def initialize(user)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
|
35
|
+
|
36
|
+
class Category < ActiveRecord::Base
|
37
|
+
connection.create_table(table_name) do |t|
|
38
|
+
t.boolean :visible
|
39
|
+
end
|
40
|
+
has_many :projects
|
41
|
+
end
|
42
|
+
|
43
|
+
class Project < ActiveRecord::Base
|
44
|
+
connection.create_table(table_name) do |t|
|
45
|
+
t.integer :category_id
|
46
|
+
t.string :name
|
47
|
+
end
|
48
|
+
belongs_to :category
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,197 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: marnen-cancan
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.0.0.alpha.pre.f1cebde51a87be149b4970a3287826bb63c0ac0b
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ryan Bates
|
8
|
+
- Marnen Laibow-Koser
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-08-02 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ~>
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 2.9.0
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 2.9.0
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rails
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ~>
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 3.2.6
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ~>
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 3.2.6
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: sqlite3
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ~>
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 1.3.5
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.3.5
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: dm-core
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 1.2.0
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.2.0
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: dm-sqlite-adapter
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ~>
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 1.2.0
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ~>
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 1.2.0
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: dm-migrations
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ~>
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 1.2.0
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ~>
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 1.2.0
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: mongoid
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ~>
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 2.4.8
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ~>
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 2.4.8
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: bson_ext
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ~>
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: 1.6.2
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 1.6.2
|
126
|
+
description: Simple authorization solution for Rails which is decoupled from user
|
127
|
+
roles. All permissions are stored in a single location.
|
128
|
+
email:
|
129
|
+
- ryan@railscasts.com
|
130
|
+
- marnen@marnen.org
|
131
|
+
executables: []
|
132
|
+
extensions: []
|
133
|
+
extra_rdoc_files: []
|
134
|
+
files:
|
135
|
+
- lib/cancan/ability.rb
|
136
|
+
- lib/cancan/controller_additions.rb
|
137
|
+
- lib/cancan/controller_resource.rb
|
138
|
+
- lib/cancan/exceptions.rb
|
139
|
+
- lib/cancan/inherited_resource.rb
|
140
|
+
- lib/cancan/matchers.rb
|
141
|
+
- lib/cancan/model_adapters/abstract_adapter.rb
|
142
|
+
- lib/cancan/model_adapters/active_record_adapter.rb
|
143
|
+
- lib/cancan/model_adapters/data_mapper_adapter.rb
|
144
|
+
- lib/cancan/model_adapters/default_adapter.rb
|
145
|
+
- lib/cancan/model_adapters/mongoid_adapter.rb
|
146
|
+
- lib/cancan/model_additions.rb
|
147
|
+
- lib/cancan/rule.rb
|
148
|
+
- lib/cancan.rb
|
149
|
+
- lib/generators/cancan/ability/ability_generator.rb
|
150
|
+
- lib/generators/cancan/ability/templates/ability.rb
|
151
|
+
- lib/generators/cancan/ability/templates/ability_spec.rb
|
152
|
+
- lib/generators/cancan/ability/templates/ability_test.rb
|
153
|
+
- lib/generators/cancan/ability/USAGE
|
154
|
+
- spec/cancan/ability_spec.rb
|
155
|
+
- spec/cancan/controller_additions_spec.rb
|
156
|
+
- spec/cancan/controller_resource_spec.rb
|
157
|
+
- spec/cancan/exceptions_spec.rb
|
158
|
+
- spec/cancan/inherited_resource_spec.rb
|
159
|
+
- spec/cancan/matchers_spec.rb
|
160
|
+
- spec/cancan/model_adapters/active_record_adapter_spec.rb
|
161
|
+
- spec/cancan/model_adapters/data_mapper_adapter_spec.rb
|
162
|
+
- spec/cancan/model_adapters/default_adapter_spec.rb
|
163
|
+
- spec/cancan/model_adapters/mongoid_adapter_spec.rb
|
164
|
+
- spec/cancan/rule_spec.rb
|
165
|
+
- spec/matchers.rb
|
166
|
+
- spec/README.rdoc
|
167
|
+
- spec/spec_helper.rb
|
168
|
+
- CHANGELOG.rdoc
|
169
|
+
- Gemfile
|
170
|
+
- LICENSE
|
171
|
+
- Rakefile
|
172
|
+
- README.rdoc
|
173
|
+
- init.rb
|
174
|
+
homepage: http://github.com/marnen/cancan
|
175
|
+
licenses: []
|
176
|
+
metadata: {}
|
177
|
+
post_install_message:
|
178
|
+
rdoc_options: []
|
179
|
+
require_paths:
|
180
|
+
- lib
|
181
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - ! '>='
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '0'
|
186
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
|
+
requirements:
|
188
|
+
- - ! '>='
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: 1.3.4
|
191
|
+
requirements: []
|
192
|
+
rubyforge_project: marnen-cancan
|
193
|
+
rubygems_version: 2.1.11
|
194
|
+
signing_key:
|
195
|
+
specification_version: 4
|
196
|
+
summary: Simple authorization solution for Rails.
|
197
|
+
test_files: []
|