rolify 3.0.0 → 3.1.0
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.
- data/CHANGELOG.rdoc +13 -1
- data/{README.rdoc → README.md} +69 -41
- data/lib/generators/rolify/role/role_generator.rb +2 -2
- data/lib/generators/rolify/role/templates/initializer.rb +3 -3
- data/lib/generators/rolify/role/templates/role-mongoid.rb +9 -0
- data/lib/rolify.rb +10 -7
- data/lib/rolify/adapters/active_record/resource_adapter.rb +17 -0
- data/lib/rolify/adapters/{active_record.rb → active_record/role_adapter.rb} +12 -21
- data/lib/rolify/adapters/base.rb +24 -22
- data/lib/rolify/adapters/mongoid/resource_adapter.rb +23 -0
- data/lib/rolify/adapters/{mongoid.rb → mongoid/role_adapter.rb} +11 -31
- data/lib/rolify/configure.rb +5 -4
- data/lib/rolify/dynamic.rb +1 -1
- data/lib/rolify/role.rb +11 -7
- data/lib/rolify/utils.rb +10 -0
- data/lib/rolify/version.rb +1 -1
- data/rolify.gemspec +1 -1
- data/spec/generators/rolify/role/role_generator_spec.rb +41 -19
- data/spec/rolify/config_spec.rb +13 -11
- data/spec/rolify/resource_spec.rb +28 -29
- data/spec/rolify/shared_contexts.rb +17 -17
- data/spec/rolify/shared_examples/{shared_examples_for_has_role_setter.rb → shared_examples_for_add_role.rb} +16 -16
- data/spec/rolify/shared_examples/shared_examples_for_dynamic.rb +6 -6
- data/spec/rolify/shared_examples/shared_examples_for_has_any_role.rb +6 -6
- data/spec/rolify/shared_examples/{shared_examples_for_has_role_getter.rb → shared_examples_for_has_role.rb} +0 -0
- data/spec/rolify/shared_examples/{shared_examples_for_has_no_role.rb → shared_examples_for_remove_role.rb} +37 -13
- data/spec/rolify/shared_examples/shared_examples_for_roles.rb +18 -20
- data/spec/spec_helper.rb +0 -4
- data/spec/support/adapters/active_record.rb +2 -0
- data/spec/support/adapters/mongoid.rb +2 -0
- metadata +33 -31
@@ -11,13 +11,13 @@ shared_context "global role", :scope => :global do
|
|
11
11
|
def load_roles
|
12
12
|
role_class.destroy_all
|
13
13
|
admin.roles = []
|
14
|
-
admin.
|
15
|
-
admin.
|
16
|
-
admin.
|
17
|
-
admin.
|
18
|
-
admin.
|
19
|
-
admin.
|
20
|
-
admin.
|
14
|
+
admin.add_role :admin
|
15
|
+
admin.add_role :staff
|
16
|
+
admin.add_role :manager, Group
|
17
|
+
admin.add_role :player, Forum
|
18
|
+
admin.add_role :moderator, Forum.last
|
19
|
+
admin.add_role :moderator, Group.last
|
20
|
+
admin.add_role :anonymous, Forum.first
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -34,12 +34,12 @@ shared_context "class scoped role", :scope => :class do
|
|
34
34
|
def load_roles
|
35
35
|
role_class.destroy_all
|
36
36
|
manager.roles = []
|
37
|
-
manager.
|
38
|
-
manager.
|
39
|
-
manager.
|
40
|
-
manager.
|
41
|
-
manager.
|
42
|
-
manager.
|
37
|
+
manager.add_role :manager, Forum
|
38
|
+
manager.add_role :player, Forum
|
39
|
+
manager.add_role :warrior
|
40
|
+
manager.add_role :moderator, Forum.last
|
41
|
+
manager.add_role :moderator, Group.last
|
42
|
+
manager.add_role :anonymous, Forum.first
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
@@ -56,10 +56,10 @@ shared_context "instance scoped role", :scope => :instance do
|
|
56
56
|
def load_roles
|
57
57
|
role_class.destroy_all
|
58
58
|
moderator.roles = []
|
59
|
-
moderator.
|
60
|
-
moderator.
|
61
|
-
moderator.
|
62
|
-
moderator.
|
59
|
+
moderator.add_role :moderator, Forum.first
|
60
|
+
moderator.add_role :anonymous, Forum.last
|
61
|
+
moderator.add_role :visitor, Forum
|
62
|
+
moderator.add_role :soldier
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
@@ -1,12 +1,12 @@
|
|
1
|
-
shared_examples_for "#
|
1
|
+
shared_examples_for "#add_role_examples" do |param_name, param_method|
|
2
2
|
context "using #{param_name} as parameter" do
|
3
3
|
context "with a global role", :scope => :global do
|
4
4
|
it "should add the role to the user" do
|
5
|
-
expect { subject.
|
5
|
+
expect { subject.add_role "root".send(param_method) }.to change { subject.roles.count }.by(1)
|
6
6
|
end
|
7
7
|
|
8
8
|
it "should create a role to the roles table" do
|
9
|
-
expect { subject.
|
9
|
+
expect { subject.add_role "moderator".send(param_method) }.to change { role_class.count }.by(1)
|
10
10
|
end
|
11
11
|
|
12
12
|
context "considering a new global role" do
|
@@ -19,24 +19,24 @@ shared_examples_for "#has_role_examples" do |param_name, param_method|
|
|
19
19
|
|
20
20
|
context "should not create another role" do
|
21
21
|
it "if the role was already assigned to the user" do
|
22
|
-
subject.
|
23
|
-
expect { subject.
|
22
|
+
subject.add_role "manager".send(param_method)
|
23
|
+
expect { subject.add_role "manager".send(param_method) }.not_to change { subject.roles.size }
|
24
24
|
end
|
25
25
|
|
26
26
|
it "if the role already exists in the db" do
|
27
27
|
role_class.create :name => "god"
|
28
|
-
expect { subject.
|
28
|
+
expect { subject.add_role "god".send(param_method) }.not_to change { role_class.count }
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
33
|
context "with a class scoped role", :scope => :class do
|
34
34
|
it "should add the role to the user" do
|
35
|
-
expect { subject.
|
35
|
+
expect { subject.add_role "supervisor".send(param_method), Forum }.to change { subject.roles.count }.by(1)
|
36
36
|
end
|
37
37
|
|
38
38
|
it "should create a role in the roles table" do
|
39
|
-
expect { subject.
|
39
|
+
expect { subject.add_role "moderator".send(param_method), Forum }.to change { role_class.count }.by(1)
|
40
40
|
end
|
41
41
|
|
42
42
|
context "considering a new class scoped role" do
|
@@ -49,24 +49,24 @@ shared_examples_for "#has_role_examples" do |param_name, param_method|
|
|
49
49
|
|
50
50
|
context "should not create another role" do
|
51
51
|
it "if the role was already assigned to the user" do
|
52
|
-
subject.
|
53
|
-
expect { subject.
|
52
|
+
subject.add_role "warrior".send(param_method), Forum
|
53
|
+
expect { subject.add_role "warrior".send(param_method), Forum }.not_to change { subject.roles.size }
|
54
54
|
end
|
55
55
|
|
56
56
|
it "if already existing in the database" do
|
57
57
|
role_class.create :name => "hacker", :resource_type => "Forum"
|
58
|
-
expect { subject.
|
58
|
+
expect { subject.add_role "hacker".send(param_method), Forum }.not_to change { role_class.count }
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
63
|
context "with an instance scoped role", :scope => :instance do
|
64
64
|
it "should add the role to the user" do
|
65
|
-
expect { subject.
|
65
|
+
expect { subject.add_role "visitor".send(param_method), Forum.last }.to change { subject.roles.size }.by(1)
|
66
66
|
end
|
67
67
|
|
68
68
|
it "should create a role in the roles table" do
|
69
|
-
expect { subject.
|
69
|
+
expect { subject.add_role "member".send(param_method), Forum.last }.to change { role_class.count }.by(1)
|
70
70
|
end
|
71
71
|
|
72
72
|
context "considering a new class scoped role" do
|
@@ -78,13 +78,13 @@ shared_examples_for "#has_role_examples" do |param_name, param_method|
|
|
78
78
|
|
79
79
|
context "should not create another role" do
|
80
80
|
it "if the role was already assigned to the user" do
|
81
|
-
subject.
|
82
|
-
expect { subject.
|
81
|
+
subject.add_role "anonymous".send(param_method), Forum.first
|
82
|
+
expect { subject.add_role "anonymous".send(param_method), Forum.first }.not_to change { subject.roles.size }
|
83
83
|
end
|
84
84
|
|
85
85
|
it "if already existing in the database" do
|
86
86
|
role_class.create :name => "ghost", :resource_type => "Forum", :resource_id => Forum.first.id
|
87
|
-
expect { subject.
|
87
|
+
expect { subject.add_role "ghost".send(param_method), Forum.first }.not_to change { role_class.count }
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
@@ -10,8 +10,8 @@ shared_examples_for Rolify::Dynamic do
|
|
10
10
|
context "using a global role" do
|
11
11
|
subject do
|
12
12
|
admin = user_class.first
|
13
|
-
admin.
|
14
|
-
admin.
|
13
|
+
admin.add_role :admin
|
14
|
+
admin.add_role :moderator, Forum.first
|
15
15
|
admin
|
16
16
|
end
|
17
17
|
|
@@ -27,7 +27,7 @@ shared_examples_for Rolify::Dynamic do
|
|
27
27
|
context "using a resource scoped role" do
|
28
28
|
subject do
|
29
29
|
moderator = user_class.where(:login => "moderator").first
|
30
|
-
moderator.
|
30
|
+
moderator.add_role :moderator, Forum.first
|
31
31
|
moderator
|
32
32
|
end
|
33
33
|
|
@@ -49,7 +49,7 @@ shared_examples_for Rolify::Dynamic do
|
|
49
49
|
context "using a class scoped role" do
|
50
50
|
subject do
|
51
51
|
manager = user_class.where(:login => "god").first
|
52
|
-
manager.
|
52
|
+
manager.add_role :manager, Forum
|
53
53
|
manager
|
54
54
|
end
|
55
55
|
|
@@ -77,7 +77,7 @@ shared_examples_for Rolify::Dynamic do
|
|
77
77
|
context "using a global role" do
|
78
78
|
before(:all) do
|
79
79
|
other_guy = user_class.last
|
80
|
-
other_guy.
|
80
|
+
other_guy.add_role :superman
|
81
81
|
end
|
82
82
|
|
83
83
|
it { should respond_to(:is_superman?).with(0).arguments }
|
@@ -90,7 +90,7 @@ shared_examples_for Rolify::Dynamic do
|
|
90
90
|
context "using a resource scope role" do
|
91
91
|
before(:all) do
|
92
92
|
other_guy = user_class.last
|
93
|
-
other_guy.
|
93
|
+
other_guy.add_role :batman, Forum.first
|
94
94
|
end
|
95
95
|
|
96
96
|
it { should respond_to(:is_batman?).with(0).arguments }
|
@@ -2,7 +2,7 @@ shared_examples_for "#has_any_role?_examples" do |param_name, param_method|
|
|
2
2
|
context "using #{param_name} as parameter" do
|
3
3
|
context "with a global role", :scope => :global do
|
4
4
|
before(:all) do
|
5
|
-
subject.
|
5
|
+
subject.add_role "staff".send(param_method)
|
6
6
|
end
|
7
7
|
|
8
8
|
it { subject.has_any_role?("staff".send(param_method)).should be_true }
|
@@ -21,8 +21,8 @@ shared_examples_for "#has_any_role?_examples" do |param_name, param_method|
|
|
21
21
|
|
22
22
|
context "with a class scoped role", :scope => :class do
|
23
23
|
before(:all) do
|
24
|
-
subject.
|
25
|
-
subject.
|
24
|
+
subject.add_role "player".send(param_method), Forum
|
25
|
+
subject.add_role "superhero".send(param_method)
|
26
26
|
end
|
27
27
|
|
28
28
|
it { subject.has_any_role?({ :name => "player".send(param_method), :resource => Forum }).should be_true }
|
@@ -41,9 +41,9 @@ shared_examples_for "#has_any_role?_examples" do |param_name, param_method|
|
|
41
41
|
|
42
42
|
context "with a instance scoped role", :scope => :instance do
|
43
43
|
before(:all) do
|
44
|
-
subject.
|
45
|
-
subject.
|
46
|
-
subject.
|
44
|
+
subject.add_role "visitor".send(param_method), Forum.last
|
45
|
+
subject.add_role "leader", Group
|
46
|
+
subject.add_role "warrior"
|
47
47
|
end
|
48
48
|
|
49
49
|
it { subject.has_any_role?({ :name => "visitor", :resource => Forum.last }).should be_true }
|
File without changes
|
@@ -1,8 +1,8 @@
|
|
1
|
-
shared_examples_for "#
|
1
|
+
shared_examples_for "#remove_role_examples" do |param_name, param_method|
|
2
2
|
context "using #{param_name} as parameter" do
|
3
3
|
context "removing a global role", :scope => :global do
|
4
4
|
context "being a global role of the user" do
|
5
|
-
it { expect { subject.
|
5
|
+
it { expect { subject.remove_role("admin".send(param_method)) }.to change { subject.roles.size }.by(-1) }
|
6
6
|
|
7
7
|
it { subject.has_role?("admin".send(param_method)).should be_false }
|
8
8
|
it { subject.has_role?("staff".send(param_method)).should be_true }
|
@@ -13,7 +13,7 @@ shared_examples_for "#has_no_role_examples" do |param_name, param_method|
|
|
13
13
|
end
|
14
14
|
|
15
15
|
context "being a class scoped role to the user" do
|
16
|
-
it { expect { subject.
|
16
|
+
it { expect { subject.remove_role("manager".send(param_method)) }.to change { subject.roles.size }.by(-1) }
|
17
17
|
|
18
18
|
it { subject.has_role?("admin".send(param_method)).should be_false }
|
19
19
|
it { subject.has_role?("staff".send(param_method)).should be_true }
|
@@ -24,7 +24,7 @@ shared_examples_for "#has_no_role_examples" do |param_name, param_method|
|
|
24
24
|
end
|
25
25
|
|
26
26
|
context "being instance scoped roles to the user" do
|
27
|
-
it { expect { subject.
|
27
|
+
it { expect { subject.remove_role("moderator".send(param_method)) }.to change { subject.roles.size }.by(-2) }
|
28
28
|
|
29
29
|
it { subject.has_role?("admin".send(param_method)).should be_false }
|
30
30
|
it { subject.has_role?("staff".send(param_method)).should be_true }
|
@@ -35,17 +35,41 @@ shared_examples_for "#has_no_role_examples" do |param_name, param_method|
|
|
35
35
|
end
|
36
36
|
|
37
37
|
context "not being a role of the user" do
|
38
|
-
it { expect { subject.
|
38
|
+
it { expect { subject.remove_role("superhero".send(param_method)) }.not_to change { subject.roles.size } }
|
39
|
+
end
|
40
|
+
|
41
|
+
context "used by another user" do
|
42
|
+
before do
|
43
|
+
user = user_class.last
|
44
|
+
user.add_role "staff".send(param_method)
|
45
|
+
end
|
46
|
+
|
47
|
+
it { expect { subject.remove_role("staff".send(param_method)) }.not_to change { role_class.count } }
|
48
|
+
|
49
|
+
it { subject.has_role?("admin".send(param_method)).should be_false }
|
50
|
+
it { subject.has_role?("staff".send(param_method)).should be_false }
|
51
|
+
it { subject.has_role?("manager".send(param_method), Group).should be_false }
|
52
|
+
it { subject.has_role?("moderator".send(param_method), Forum.last).should be_false }
|
53
|
+
it { subject.has_role?("moderator".send(param_method), Group.last).should be_false }
|
54
|
+
it { subject.has_role?("anonymous".send(param_method), Forum.first).should be_true }
|
55
|
+
end
|
56
|
+
|
57
|
+
context "not used by anyone else" do
|
58
|
+
before do
|
59
|
+
subject.add_role "nobody".send(param_method)
|
60
|
+
end
|
61
|
+
|
62
|
+
it { expect { subject.remove_role("nobody".send(param_method)) }.to change { role_class.count }.by(-1) }
|
39
63
|
end
|
40
64
|
end
|
41
65
|
|
42
66
|
context "removing a class scoped role", :scope => :class do
|
43
67
|
context "being a global role of the user" do
|
44
|
-
it { expect { subject.
|
68
|
+
it { expect { subject.remove_role("warrior".send(param_method), Forum) }.not_to change{ subject.roles.size } }
|
45
69
|
end
|
46
70
|
|
47
71
|
context "being a class scoped role to the user" do
|
48
|
-
it { expect { subject.
|
72
|
+
it { expect { subject.remove_role("manager".send(param_method), Forum) }.to change{ subject.roles.size }.by(-1) }
|
49
73
|
|
50
74
|
it { subject.has_role?("warrior").should be_true }
|
51
75
|
it { subject.has_role?("manager", Forum).should be_false }
|
@@ -56,7 +80,7 @@ shared_examples_for "#has_no_role_examples" do |param_name, param_method|
|
|
56
80
|
end
|
57
81
|
|
58
82
|
context "being instance scoped role to the user" do
|
59
|
-
it { expect { subject.
|
83
|
+
it { expect { subject.remove_role("moderator".send(param_method), Forum) }.to change { subject.roles.size }.by(-1) }
|
60
84
|
|
61
85
|
it { subject.has_role?("warrior").should be_true }
|
62
86
|
it { subject.has_role?("manager", Forum).should be_false }
|
@@ -67,21 +91,21 @@ shared_examples_for "#has_no_role_examples" do |param_name, param_method|
|
|
67
91
|
end
|
68
92
|
|
69
93
|
context "not being a role of the user" do
|
70
|
-
it { expect { subject.
|
94
|
+
it { expect { subject.remove_role("manager".send(param_method), Group) }.not_to change { subject.roles.size } }
|
71
95
|
end
|
72
96
|
end
|
73
97
|
|
74
98
|
context "removing a instance scoped role", :scope => :instance do
|
75
99
|
context "being a global role of the user" do
|
76
|
-
it { expect { subject.
|
100
|
+
it { expect { subject.remove_role("soldier".send(param_method), Group.first) }.not_to change { subject.roles.size } }
|
77
101
|
end
|
78
102
|
|
79
103
|
context "being a class scoped role to the user" do
|
80
|
-
it { expect { subject.
|
104
|
+
it { expect { subject.remove_role("visitor".send(param_method), Forum.first) }.not_to change { subject.roles.size } }
|
81
105
|
end
|
82
106
|
|
83
107
|
context "being instance scoped role to the user" do
|
84
|
-
it { expect { subject.
|
108
|
+
it { expect { subject.remove_role("moderator".send(param_method), Forum.first) }.to change { subject.roles.size }.by(-1) }
|
85
109
|
|
86
110
|
it { subject.has_role?("soldier").should be_true }
|
87
111
|
it { subject.has_role?("visitor", Forum).should be_true }
|
@@ -90,7 +114,7 @@ shared_examples_for "#has_no_role_examples" do |param_name, param_method|
|
|
90
114
|
end
|
91
115
|
|
92
116
|
context "not being a role of the user" do
|
93
|
-
it { expect { subject.
|
117
|
+
it { expect { subject.remove_role("anonymous".send(param_method), Forum.first) }.not_to change { subject.roles.size } }
|
94
118
|
end
|
95
119
|
end
|
96
120
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require "rolify/shared_contexts"
|
2
|
-
require "rolify/shared_examples/
|
3
|
-
require "rolify/shared_examples/
|
2
|
+
require "rolify/shared_examples/shared_examples_for_add_role"
|
3
|
+
require "rolify/shared_examples/shared_examples_for_has_role"
|
4
4
|
require "rolify/shared_examples/shared_examples_for_has_all_roles"
|
5
5
|
require "rolify/shared_examples/shared_examples_for_has_any_role"
|
6
|
-
require "rolify/shared_examples/
|
6
|
+
require "rolify/shared_examples/shared_examples_for_remove_role"
|
7
7
|
|
8
8
|
|
9
9
|
shared_examples_for Rolify::Role do
|
@@ -19,8 +19,8 @@ shared_examples_for Rolify::Role do
|
|
19
19
|
context "in a Instance level" do
|
20
20
|
before(:all) do
|
21
21
|
admin = user_class.first
|
22
|
-
admin.
|
23
|
-
admin.
|
22
|
+
admin.add_role :admin
|
23
|
+
admin.add_role :moderator, Forum.first
|
24
24
|
admin
|
25
25
|
end
|
26
26
|
|
@@ -28,12 +28,11 @@ shared_examples_for Rolify::Role do
|
|
28
28
|
user_class.first
|
29
29
|
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
[ :has_role, :grant, :add_role ].each do |method_alias|
|
32
|
+
it { should respond_to(method_alias.to_sym).with(1).arguments }
|
33
|
+
it { should respond_to(method_alias.to_sym).with(2).arguments }
|
34
|
+
end
|
35
|
+
|
37
36
|
it { should respond_to(:has_role?).with(1).arguments }
|
38
37
|
it { should respond_to(:has_role?).with(2).arguments }
|
39
38
|
|
@@ -43,19 +42,18 @@ shared_examples_for Rolify::Role do
|
|
43
42
|
it { should respond_to(:has_any_role?) }
|
44
43
|
it { should respond_to(:has_any_role?) }
|
45
44
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
it { should respond_to(:revoke).with(2).arguments }
|
45
|
+
[ :has_no_role, :revoke, :remove_role ].each do |method_alias|
|
46
|
+
it { should respond_to(method_alias.to_sym).with(1).arguments }
|
47
|
+
it { should respond_to(method_alias.to_sym).with(2).arguments }
|
48
|
+
end
|
51
49
|
|
52
50
|
it { should_not respond_to(:is_admin?) }
|
53
51
|
it { should_not respond_to(:is_moderator_of?) }
|
54
52
|
end
|
55
53
|
|
56
54
|
describe "#has_role" do
|
57
|
-
it_should_behave_like "#
|
58
|
-
it_should_behave_like "#
|
55
|
+
it_should_behave_like "#add_role_examples", "String", :to_s
|
56
|
+
it_should_behave_like "#add_role_examples", "Symbol", :to_sym
|
59
57
|
end
|
60
58
|
|
61
59
|
describe "#has_role?" do
|
@@ -74,7 +72,7 @@ shared_examples_for Rolify::Role do
|
|
74
72
|
end
|
75
73
|
|
76
74
|
describe "#has_no_role" do
|
77
|
-
it_should_behave_like "#
|
78
|
-
it_should_behave_like "#
|
75
|
+
it_should_behave_like "#remove_role_examples", "String", :to_s
|
76
|
+
it_should_behave_like "#remove_role_examples", "Symbol", :to_sym
|
79
77
|
end
|
80
78
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rolify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sqlite3
|
16
|
-
requirement: &
|
16
|
+
requirement: &70359244800420 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70359244800420
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activerecord
|
27
|
-
requirement: &
|
27
|
+
requirement: &70359244799000 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 3.1.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70359244799000
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: mongoid
|
38
|
-
requirement: &
|
38
|
+
requirement: &70359244797140 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '2.3'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70359244797140
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bson_ext
|
49
|
-
requirement: &
|
49
|
+
requirement: &70359244794900 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70359244794900
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: ammeter
|
60
|
-
requirement: &
|
60
|
+
requirement: &70359244792460 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70359244792460
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
|
-
requirement: &
|
71
|
+
requirement: &70359244791380 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70359244791380
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rspec
|
82
|
-
requirement: &
|
82
|
+
requirement: &70359244788860 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70359244788860
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: bundler
|
93
|
-
requirement: &
|
93
|
+
requirement: &70359244786160 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,9 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
102
|
-
description:
|
103
|
-
|
104
|
-
=> # return false if user is moderator of another Forum '
|
101
|
+
version_requirements: *70359244786160
|
102
|
+
description: Very simple Roles library without any authorization enforcement supporting
|
103
|
+
scope on resource objects (instance or class)
|
105
104
|
email:
|
106
105
|
- f.monbillard@gmail.com
|
107
106
|
executables: []
|
@@ -113,7 +112,7 @@ files:
|
|
113
112
|
- CHANGELOG.rdoc
|
114
113
|
- Gemfile
|
115
114
|
- LICENSE
|
116
|
-
- README.
|
115
|
+
- README.md
|
117
116
|
- Rakefile
|
118
117
|
- UPGRADE.rdoc
|
119
118
|
- lib/generators/rolify/role/role_generator.rb
|
@@ -125,14 +124,17 @@ files:
|
|
125
124
|
- lib/generators/rolify/role/templates/role-active_record.rb
|
126
125
|
- lib/generators/rolify/role/templates/role-mongoid.rb
|
127
126
|
- lib/rolify.rb
|
128
|
-
- lib/rolify/adapters/active_record.rb
|
127
|
+
- lib/rolify/adapters/active_record/resource_adapter.rb
|
128
|
+
- lib/rolify/adapters/active_record/role_adapter.rb
|
129
129
|
- lib/rolify/adapters/base.rb
|
130
|
-
- lib/rolify/adapters/mongoid.rb
|
130
|
+
- lib/rolify/adapters/mongoid/resource_adapter.rb
|
131
|
+
- lib/rolify/adapters/mongoid/role_adapter.rb
|
131
132
|
- lib/rolify/configure.rb
|
132
133
|
- lib/rolify/dynamic.rb
|
133
134
|
- lib/rolify/railtie.rb
|
134
135
|
- lib/rolify/resource.rb
|
135
136
|
- lib/rolify/role.rb
|
137
|
+
- lib/rolify/utils.rb
|
136
138
|
- lib/rolify/version.rb
|
137
139
|
- rolify.gemspec
|
138
140
|
- spec/generators/rolify/role/role_generator_spec.rb
|
@@ -141,12 +143,12 @@ files:
|
|
141
143
|
- spec/rolify/resource_spec.rb
|
142
144
|
- spec/rolify/role_spec.rb
|
143
145
|
- spec/rolify/shared_contexts.rb
|
146
|
+
- spec/rolify/shared_examples/shared_examples_for_add_role.rb
|
144
147
|
- spec/rolify/shared_examples/shared_examples_for_dynamic.rb
|
145
148
|
- spec/rolify/shared_examples/shared_examples_for_has_all_roles.rb
|
146
149
|
- spec/rolify/shared_examples/shared_examples_for_has_any_role.rb
|
147
|
-
- spec/rolify/shared_examples/
|
148
|
-
- spec/rolify/shared_examples/
|
149
|
-
- spec/rolify/shared_examples/shared_examples_for_has_role_setter.rb
|
150
|
+
- spec/rolify/shared_examples/shared_examples_for_has_role.rb
|
151
|
+
- spec/rolify/shared_examples/shared_examples_for_remove_role.rb
|
150
152
|
- spec/rolify/shared_examples/shared_examples_for_roles.rb
|
151
153
|
- spec/spec_helper.rb
|
152
154
|
- spec/support/adapters/active_record.rb
|
@@ -173,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
175
|
version: '0'
|
174
176
|
requirements: []
|
175
177
|
rubyforge_project: rolify
|
176
|
-
rubygems_version: 1.8.
|
178
|
+
rubygems_version: 1.8.17
|
177
179
|
signing_key:
|
178
180
|
specification_version: 3
|
179
181
|
summary: Roles library with resource scoping
|
@@ -184,12 +186,12 @@ test_files:
|
|
184
186
|
- spec/rolify/resource_spec.rb
|
185
187
|
- spec/rolify/role_spec.rb
|
186
188
|
- spec/rolify/shared_contexts.rb
|
189
|
+
- spec/rolify/shared_examples/shared_examples_for_add_role.rb
|
187
190
|
- spec/rolify/shared_examples/shared_examples_for_dynamic.rb
|
188
191
|
- spec/rolify/shared_examples/shared_examples_for_has_all_roles.rb
|
189
192
|
- spec/rolify/shared_examples/shared_examples_for_has_any_role.rb
|
190
|
-
- spec/rolify/shared_examples/
|
191
|
-
- spec/rolify/shared_examples/
|
192
|
-
- spec/rolify/shared_examples/shared_examples_for_has_role_setter.rb
|
193
|
+
- spec/rolify/shared_examples/shared_examples_for_has_role.rb
|
194
|
+
- spec/rolify/shared_examples/shared_examples_for_remove_role.rb
|
193
195
|
- spec/rolify/shared_examples/shared_examples_for_roles.rb
|
194
196
|
- spec/spec_helper.rb
|
195
197
|
- spec/support/adapters/active_record.rb
|