mongoid_ability 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +22 -0
- data/.travis.yml +14 -0
- data/Gemfile +4 -0
- data/Guardfile +8 -0
- data/LICENSE.txt +22 -0
- data/README.md +154 -0
- data/Rakefile +9 -0
- data/lib/mongoid_ability.rb +17 -0
- data/lib/mongoid_ability/ability.rb +29 -0
- data/lib/mongoid_ability/ability_resolver.rb +87 -0
- data/lib/mongoid_ability/lock.rb +64 -0
- data/lib/mongoid_ability/owner.rb +59 -0
- data/lib/mongoid_ability/subject.rb +80 -0
- data/lib/mongoid_ability/version.rb +3 -0
- data/mongoid_ability.gemspec +31 -0
- data/test/mongoid_ability/ability_resolver_test.rb +208 -0
- data/test/mongoid_ability/ability_test.rb +91 -0
- data/test/mongoid_ability/lock_test.rb +57 -0
- data/test/mongoid_ability/owner_test.rb +53 -0
- data/test/mongoid_ability/subject_test.rb +102 -0
- data/test/test_helper.rb +122 -0
- metadata +200 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
module MongoidAbility
|
|
4
|
+
describe Lock do
|
|
5
|
+
|
|
6
|
+
subject { TestLock.new }
|
|
7
|
+
|
|
8
|
+
# =====================================================================
|
|
9
|
+
|
|
10
|
+
describe 'fields' do
|
|
11
|
+
it 'has :action' do
|
|
12
|
+
subject.must_respond_to :action
|
|
13
|
+
subject.action.must_be_kind_of Symbol
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'has :outcome' do
|
|
17
|
+
subject.must_respond_to :outcome
|
|
18
|
+
subject.outcome.must_equal false
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# =====================================================================
|
|
23
|
+
|
|
24
|
+
describe 'associations' do
|
|
25
|
+
it 'embedded in :owner' do
|
|
26
|
+
subject.must_respond_to :owner
|
|
27
|
+
subject.relations['owner'].macro.must_equal :embedded_in
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it 'belongs to :subject' do
|
|
31
|
+
subject.must_respond_to :subject
|
|
32
|
+
subject.must_respond_to :subject_type
|
|
33
|
+
subject.must_respond_to :subject_id
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# =====================================================================
|
|
38
|
+
|
|
39
|
+
describe 'instance methods' do
|
|
40
|
+
it 'has #open?' do
|
|
41
|
+
subject.must_respond_to :open?
|
|
42
|
+
subject.open?.must_equal false
|
|
43
|
+
end
|
|
44
|
+
it 'has #closed?' do
|
|
45
|
+
subject.must_respond_to :closed?
|
|
46
|
+
subject.closed?.must_equal true
|
|
47
|
+
end
|
|
48
|
+
it 'has #class_lock?' do
|
|
49
|
+
subject.must_respond_to :class_lock?
|
|
50
|
+
end
|
|
51
|
+
it 'has #id_lock?' do
|
|
52
|
+
subject.must_respond_to :id_lock?
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
module MongoidAbility
|
|
4
|
+
describe Owner do
|
|
5
|
+
|
|
6
|
+
subject { TestOwner.new }
|
|
7
|
+
|
|
8
|
+
# =====================================================================
|
|
9
|
+
|
|
10
|
+
describe 'fields' do
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# =====================================================================
|
|
14
|
+
|
|
15
|
+
describe 'associations' do
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# =====================================================================
|
|
19
|
+
|
|
20
|
+
describe 'class methods' do
|
|
21
|
+
describe 'lock_class_name' do
|
|
22
|
+
it 'finds class that includes the MongoidAbility::Lock module' do
|
|
23
|
+
TestOwner.lock_class_name.must_equal 'TestLock'
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
describe 'locks_relation_name' do
|
|
28
|
+
it 'finds the name of relation that contains locks' do
|
|
29
|
+
TestOwner.locks_relation_name.must_equal :test_locks
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# =====================================================================
|
|
35
|
+
|
|
36
|
+
describe 'instance methods' do
|
|
37
|
+
describe 'cleanup_locks' do
|
|
38
|
+
let(:closed_lock) { TestLock.new(action: :read, outcome: false, subject_type: Object.to_s) }
|
|
39
|
+
let(:open_lock) { TestLock.new(action: :read, outcome: true, subject_type: Object.to_s) }
|
|
40
|
+
|
|
41
|
+
before do
|
|
42
|
+
subject.test_locks = [open_lock, closed_lock].shuffle
|
|
43
|
+
subject.run_callbacks(:save)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it 'prefers closed locks' do
|
|
47
|
+
subject.test_locks.sort.must_equal [closed_lock].sort
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
module MongoidAbility
|
|
4
|
+
describe Subject do
|
|
5
|
+
|
|
6
|
+
subject { TestSubject.new }
|
|
7
|
+
let(:subject_super) { TestSubjectSuper.new }
|
|
8
|
+
|
|
9
|
+
let(:user) { TestUser.new }
|
|
10
|
+
let(:ability) { Ability.new(user) }
|
|
11
|
+
|
|
12
|
+
let(:open_lock) { TestLock.new(outcome: true, action: :read, subject: subject) }
|
|
13
|
+
let(:closed_lock) { TestLock.new(outcome: false, action: :read, subject: subject) }
|
|
14
|
+
|
|
15
|
+
# =====================================================================
|
|
16
|
+
|
|
17
|
+
describe 'fields' do
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# =====================================================================
|
|
21
|
+
|
|
22
|
+
describe 'relations' do
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# =====================================================================
|
|
26
|
+
|
|
27
|
+
describe 'class methods' do
|
|
28
|
+
it 'has .default_locks' do
|
|
29
|
+
subject.class.must_respond_to :default_locks
|
|
30
|
+
subject.class.default_locks.must_be_kind_of Array
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it 'has .default_lock' do
|
|
34
|
+
subject.class.must_respond_to :default_lock
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
describe '.default_lock' do
|
|
38
|
+
it 'sets up new Lock' do
|
|
39
|
+
lock = subject.class.default_locks.first
|
|
40
|
+
subject.class.default_locks.length.must_equal 1
|
|
41
|
+
lock.subject_type.must_equal subject.class.model_name
|
|
42
|
+
lock.subject_id.must_be_nil
|
|
43
|
+
lock.action.must_equal :read
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# ---------------------------------------------------------------------
|
|
48
|
+
|
|
49
|
+
describe '.ancestors_with_default_locks' do
|
|
50
|
+
it 'lists ancestors with default locks' do
|
|
51
|
+
subject.class.ancestors_with_default_locks.must_equal [TestSubjectSuper]
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
describe '.self_and_ancestors_with_default_locks' do
|
|
56
|
+
it 'lists self and ancestors with default locks' do
|
|
57
|
+
subject.class.self_and_ancestors_with_default_locks.must_equal [TestSubject, TestSubjectSuper]
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# ---------------------------------------------------------------------
|
|
62
|
+
|
|
63
|
+
describe '.accessible_by' do
|
|
64
|
+
it 'returns Mongoid::Criteria' do
|
|
65
|
+
subject.class.accessible_by(ability).must_be_kind_of Mongoid::Criteria
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
describe 'when closed lock on user' do
|
|
69
|
+
before { user.test_locks = [closed_lock] }
|
|
70
|
+
it 'returns criteria excluding such ids' do
|
|
71
|
+
subject.class.accessible_by(ability).selector.fetch('_id', {}).fetch('$nin', []).must_include subject.id
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
describe "when closed lock on user's role" do
|
|
76
|
+
before { user.roles = [TestRole.new(test_locks: [closed_lock])] }
|
|
77
|
+
it 'returns criteria excluding such ids' do
|
|
78
|
+
subject.class.accessible_by(ability).selector.fetch('_id', {}).fetch('$nin', []).must_include subject.id
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
describe "when class does not permit" do
|
|
83
|
+
before do
|
|
84
|
+
user.test_locks = [open_lock]
|
|
85
|
+
end
|
|
86
|
+
it 'returns criteria excluding everything but open id_locks' do
|
|
87
|
+
subject.class.stub(:default_locks, [TestLock.new(outcome: false, action: :read, subject_type: subject.class, outcome: false)]) do
|
|
88
|
+
subject.class.accessible_by(ability).selector.fetch('_id', {}).fetch('$in', []).must_include subject.id
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# =====================================================================
|
|
98
|
+
|
|
99
|
+
describe 'instance methods' do
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
end
|
data/test/test_helper.rb
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
require 'bundler/setup'
|
|
2
|
+
require 'database_cleaner'
|
|
3
|
+
require 'minitest'
|
|
4
|
+
require 'minitest/autorun'
|
|
5
|
+
require 'minitest/spec'
|
|
6
|
+
require 'mongoid'
|
|
7
|
+
|
|
8
|
+
require 'mongoid_ability'
|
|
9
|
+
|
|
10
|
+
# =====================================================================
|
|
11
|
+
|
|
12
|
+
if ENV["CI"]
|
|
13
|
+
require "coveralls"
|
|
14
|
+
Coveralls.wear!
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
ENV["MONGOID_TEST_HOST"] ||= "localhost"
|
|
18
|
+
ENV["MONGOID_TEST_PORT"] ||= "27017"
|
|
19
|
+
|
|
20
|
+
HOST = ENV["MONGOID_TEST_HOST"]
|
|
21
|
+
PORT = ENV["MONGOID_TEST_PORT"].to_i
|
|
22
|
+
|
|
23
|
+
def database_id
|
|
24
|
+
"mongoid_ability_test"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
CONFIG = {
|
|
28
|
+
sessions: {
|
|
29
|
+
default: {
|
|
30
|
+
database: database_id,
|
|
31
|
+
hosts: [ "#{HOST}:#{PORT}" ]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
Mongoid.configure do |config|
|
|
37
|
+
config.load_configuration(CONFIG)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
DatabaseCleaner.orm = :mongoid
|
|
41
|
+
DatabaseCleaner.strategy = :truncation
|
|
42
|
+
|
|
43
|
+
class MiniTest::Spec
|
|
44
|
+
before(:each) { DatabaseCleaner.start }
|
|
45
|
+
after(:each) { DatabaseCleaner.clean }
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# =====================================================================
|
|
49
|
+
|
|
50
|
+
class TestLock
|
|
51
|
+
include Mongoid::Document
|
|
52
|
+
include MongoidAbility::Lock
|
|
53
|
+
|
|
54
|
+
embedded_in :owner, polymorphic: true
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
class TestLockSub < TestLock
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# ---------------------------------------------------------------------
|
|
61
|
+
|
|
62
|
+
class TestOwnerSuper
|
|
63
|
+
include Mongoid::Document
|
|
64
|
+
include MongoidAbility::Owner
|
|
65
|
+
|
|
66
|
+
embeds_many :test_locks, class_name: 'TestLock', as: :owner
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
class TestOwner < TestOwnerSuper
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# ---------------------------------------------------------------------
|
|
73
|
+
|
|
74
|
+
class TestSubjectSuper
|
|
75
|
+
include Mongoid::Document
|
|
76
|
+
include MongoidAbility::Subject
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
class TestSubject < TestSubjectSuper
|
|
80
|
+
default_lock :read, true
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# ---------------------------------------------------------------------
|
|
84
|
+
|
|
85
|
+
class TestAbilityResolverSubject
|
|
86
|
+
include Mongoid::Document
|
|
87
|
+
include MongoidAbility::Subject
|
|
88
|
+
|
|
89
|
+
default_lock :read, true
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
class TestAbilitySubjectSuper2
|
|
93
|
+
include Mongoid::Document
|
|
94
|
+
include MongoidAbility::Subject
|
|
95
|
+
|
|
96
|
+
default_lock :read, false
|
|
97
|
+
default_lock :update, true
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
class TestAbilitySubjectSuper1 < TestAbilitySubjectSuper2
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
class TestAbilitySubject < TestAbilitySubjectSuper1
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
class TestRole
|
|
107
|
+
include Mongoid::Document
|
|
108
|
+
include MongoidAbility::Owner
|
|
109
|
+
|
|
110
|
+
field :name, type: String
|
|
111
|
+
|
|
112
|
+
embeds_many :test_locks, class_name: 'TestLock', as: :owner
|
|
113
|
+
has_and_belongs_to_many :users, class_name: 'TestUser'
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
class TestUser
|
|
117
|
+
include Mongoid::Document
|
|
118
|
+
include MongoidAbility::Owner
|
|
119
|
+
|
|
120
|
+
embeds_many :test_locks, class_name: 'TestLock', as: :owner
|
|
121
|
+
has_and_belongs_to_many :roles, class_name: 'TestRole'
|
|
122
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: mongoid_ability
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Tomas Celizna
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2014-12-30 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: cancancan
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.9'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.9'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: mongoid
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '4.0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '4.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: bundler
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '1.6'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '1.6'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: coveralls
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: database_cleaner
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: guard
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: guard-minitest
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '0'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: minitest
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - ">="
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '0'
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '0'
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: rake
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - ">="
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: '0'
|
|
132
|
+
type: :development
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - ">="
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: '0'
|
|
139
|
+
description: Custom Ability class that allows CanCanCan authorization library store
|
|
140
|
+
permissions in MongoDB via the Mongoid gem.
|
|
141
|
+
email:
|
|
142
|
+
- tomas.celizna@gmail.com
|
|
143
|
+
executables: []
|
|
144
|
+
extensions: []
|
|
145
|
+
extra_rdoc_files: []
|
|
146
|
+
files:
|
|
147
|
+
- ".coveralls.yml"
|
|
148
|
+
- ".gitignore"
|
|
149
|
+
- ".travis.yml"
|
|
150
|
+
- Gemfile
|
|
151
|
+
- Guardfile
|
|
152
|
+
- LICENSE.txt
|
|
153
|
+
- README.md
|
|
154
|
+
- Rakefile
|
|
155
|
+
- lib/mongoid_ability.rb
|
|
156
|
+
- lib/mongoid_ability/ability.rb
|
|
157
|
+
- lib/mongoid_ability/ability_resolver.rb
|
|
158
|
+
- lib/mongoid_ability/lock.rb
|
|
159
|
+
- lib/mongoid_ability/owner.rb
|
|
160
|
+
- lib/mongoid_ability/subject.rb
|
|
161
|
+
- lib/mongoid_ability/version.rb
|
|
162
|
+
- mongoid_ability.gemspec
|
|
163
|
+
- test/mongoid_ability/ability_resolver_test.rb
|
|
164
|
+
- test/mongoid_ability/ability_test.rb
|
|
165
|
+
- test/mongoid_ability/lock_test.rb
|
|
166
|
+
- test/mongoid_ability/owner_test.rb
|
|
167
|
+
- test/mongoid_ability/subject_test.rb
|
|
168
|
+
- test/test_helper.rb
|
|
169
|
+
homepage: https://github.com/tomasc/mongoid_ability
|
|
170
|
+
licenses:
|
|
171
|
+
- MIT
|
|
172
|
+
metadata: {}
|
|
173
|
+
post_install_message:
|
|
174
|
+
rdoc_options: []
|
|
175
|
+
require_paths:
|
|
176
|
+
- lib
|
|
177
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
|
+
requirements:
|
|
179
|
+
- - ">="
|
|
180
|
+
- !ruby/object:Gem::Version
|
|
181
|
+
version: '0'
|
|
182
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
|
+
requirements:
|
|
184
|
+
- - ">="
|
|
185
|
+
- !ruby/object:Gem::Version
|
|
186
|
+
version: '0'
|
|
187
|
+
requirements: []
|
|
188
|
+
rubyforge_project:
|
|
189
|
+
rubygems_version: 2.2.2
|
|
190
|
+
signing_key:
|
|
191
|
+
specification_version: 4
|
|
192
|
+
summary: Custom Ability class that allows CanCanCan authorization library store permissions
|
|
193
|
+
in MongoDB via the Mongoid gem.
|
|
194
|
+
test_files:
|
|
195
|
+
- test/mongoid_ability/ability_resolver_test.rb
|
|
196
|
+
- test/mongoid_ability/ability_test.rb
|
|
197
|
+
- test/mongoid_ability/lock_test.rb
|
|
198
|
+
- test/mongoid_ability/owner_test.rb
|
|
199
|
+
- test/mongoid_ability/subject_test.rb
|
|
200
|
+
- test/test_helper.rb
|