rolify 3.3.0.rc3 → 3.3.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.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.travis.yml +12 -11
- data/CHANGELOG.rdoc +18 -0
- data/Gemfile +20 -3
- data/README.md +84 -70
- data/Rakefile +21 -8
- data/UPGRADE.rdoc +22 -0
- data/gemfiles/Gemfile.rails-3.2 +21 -0
- data/gemfiles/Gemfile.rails-4.0 +27 -0
- data/lib/generators/mongoid/rolify_generator.rb +1 -1
- data/lib/generators/rolify/templates/README +1 -1
- data/lib/rolify/adapters/active_record/resource_adapter.rb +8 -7
- data/lib/rolify/adapters/active_record/role_adapter.rb +13 -9
- data/lib/rolify/configure.rb +1 -1
- data/lib/rolify/railtie.rb +1 -1
- data/lib/rolify/role.rb +3 -5
- data/lib/rolify/version.rb +1 -1
- data/lib/rolify.rb +13 -10
- data/rolify.gemspec +5 -12
- data/spec/README.rdoc +24 -0
- data/spec/generators/rolify/{rolify_generator_spec.rb → rolify_activerecord_generator_spec.rb} +13 -104
- data/spec/generators/rolify/rolify_mongoid_generator_spec.rb +112 -0
- data/spec/generators_helper.rb +8 -1
- data/spec/rolify/custom_spec.rb +9 -16
- data/spec/rolify/namespace_spec.rb +12 -15
- data/spec/rolify/resource_spec.rb +20 -2
- data/spec/rolify/resourcifed_and_rolifed_spec.rb +5 -1
- data/spec/rolify/role_spec.rb +9 -16
- data/spec/rolify/shared_contexts.rb +9 -3
- data/spec/rolify/shared_examples/shared_examples_for_add_role.rb +2 -2
- data/spec/rolify/shared_examples/shared_examples_for_callbacks.rb +12 -4
- data/spec/rolify/shared_examples/shared_examples_for_dynamic.rb +43 -2
- data/spec/rolify/shared_examples/shared_examples_for_has_any_role.rb +3 -3
- data/spec/rolify/shared_examples/shared_examples_for_only_has_role.rb +3 -3
- data/spec/rolify/shared_examples/shared_examples_for_roles.rb +5 -3
- data/spec/rolify/shared_examples/shared_examples_for_scopes.rb +10 -10
- data/spec/spec_helper.rb +3 -0
- data/spec/support/adapters/active_record.rb +9 -2
- data/spec/support/adapters/mongoid.rb +8 -4
- data/spec/support/data.rb +3 -0
- data/spec/support/schema.rb +6 -1
- metadata +51 -110
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
shared_examples_for Rolify::Dynamic do
|
|
1
|
+
shared_examples_for Rolify::Dynamic do
|
|
2
2
|
before(:all) do
|
|
3
3
|
Rolify.dynamic_shortcuts = true
|
|
4
4
|
role_class.destroy_all
|
|
5
|
-
|
|
5
|
+
rolify_options = { :role_cname => role_class.to_s }
|
|
6
|
+
rolify_options[:role_join_table_name] = join_table if defined? join_table
|
|
7
|
+
user_class.rolify rolify_options
|
|
6
8
|
Forum.resourcify :roles, :role_cname => role_class.to_s
|
|
7
9
|
Group.resourcify :roles, :role_cname => role_class.to_s
|
|
8
10
|
end
|
|
@@ -12,6 +14,7 @@ shared_examples_for Rolify::Dynamic do
|
|
|
12
14
|
admin = user_class.first
|
|
13
15
|
admin.add_role :admin
|
|
14
16
|
admin.add_role :moderator, Forum.first
|
|
17
|
+
admin.add_role :solo
|
|
15
18
|
admin
|
|
16
19
|
end
|
|
17
20
|
|
|
@@ -22,12 +25,22 @@ shared_examples_for Rolify::Dynamic do
|
|
|
22
25
|
it { subject.is_admin?.should be(true) }
|
|
23
26
|
it { subject.is_admin?.should be(true) }
|
|
24
27
|
it { subject.is_admin?.should be(true) }
|
|
28
|
+
|
|
29
|
+
context "removing the role on the last user having it" do
|
|
30
|
+
before do
|
|
31
|
+
subject.remove_role :solo
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it { should_not respond_to(:is_solo?) }
|
|
35
|
+
it { subject.is_solo?.should be(false) }
|
|
36
|
+
end
|
|
25
37
|
end
|
|
26
38
|
|
|
27
39
|
context "using a resource scoped role" do
|
|
28
40
|
subject do
|
|
29
41
|
moderator = user_class.where(:login => "moderator").first
|
|
30
42
|
moderator.add_role :moderator, Forum.first
|
|
43
|
+
moderator.add_role :sole_mio, Forum.last
|
|
31
44
|
moderator
|
|
32
45
|
end
|
|
33
46
|
|
|
@@ -44,12 +57,22 @@ shared_examples_for Rolify::Dynamic do
|
|
|
44
57
|
it { subject.is_moderator_of?(Group).should be(false) }
|
|
45
58
|
it { subject.is_moderator_of?(Group.first).should be(false) }
|
|
46
59
|
it { subject.is_moderator_of?(Group.last).should be(false) }
|
|
60
|
+
|
|
61
|
+
context "removing the role on the last user having it" do
|
|
62
|
+
before do
|
|
63
|
+
subject.remove_role :sole_mio, Forum.last
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it { should_not respond_to(:is_sole_mio?) }
|
|
67
|
+
it { subject.is_sole_mio?.should be(false) }
|
|
68
|
+
end
|
|
47
69
|
end
|
|
48
70
|
|
|
49
71
|
context "using a class scoped role" do
|
|
50
72
|
subject do
|
|
51
73
|
manager = user_class.where(:login => "god").first
|
|
52
74
|
manager.add_role :manager, Forum
|
|
75
|
+
manager.add_role :only_me, Forum
|
|
53
76
|
manager
|
|
54
77
|
end
|
|
55
78
|
|
|
@@ -68,6 +91,15 @@ shared_examples_for Rolify::Dynamic do
|
|
|
68
91
|
it { subject.is_manager_of?(Group).should be(false) }
|
|
69
92
|
it { subject.is_manager_of?(Group.first).should be(false) }
|
|
70
93
|
it { subject.is_manager_of?(Group.last).should be(false) }
|
|
94
|
+
|
|
95
|
+
context "removing the role on the last user having it" do
|
|
96
|
+
before do
|
|
97
|
+
subject.remove_role :only_me, Forum
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
it { should_not respond_to(:is_only_me?) }
|
|
101
|
+
it { subject.is_only_me?.should be(false) }
|
|
102
|
+
end
|
|
71
103
|
end
|
|
72
104
|
|
|
73
105
|
context "if the role doesn't exist in the database" do
|
|
@@ -85,6 +117,7 @@ shared_examples_for Rolify::Dynamic do
|
|
|
85
117
|
it { should_not respond_to(:is_god?) }
|
|
86
118
|
|
|
87
119
|
it { subject.is_superman?.should be(false) }
|
|
120
|
+
it { subject.is_god?.should be(false) }
|
|
88
121
|
end
|
|
89
122
|
|
|
90
123
|
context "using a resource scope role" do
|
|
@@ -105,6 +138,14 @@ shared_examples_for Rolify::Dynamic do
|
|
|
105
138
|
it { subject.is_batman_of?(Group).should be(false) }
|
|
106
139
|
it { subject.is_batman_of?(Group.first).should be(false) }
|
|
107
140
|
it { subject.is_batman_of?(Group.last).should be(false) }
|
|
141
|
+
|
|
142
|
+
it { subject.is_god?.should be(false) }
|
|
143
|
+
it { subject.is_god_of?(Forum).should be(false) }
|
|
144
|
+
it { subject.is_god_of?(Forum.first).should be(false) }
|
|
145
|
+
it { subject.is_god_of?(Forum.last).should be(false) }
|
|
146
|
+
it { subject.is_god_of?(Group).should be(false) }
|
|
147
|
+
it { subject.is_god_of?(Group.first).should be(false) }
|
|
148
|
+
it { subject.is_god_of?(Group.last).should be(false) }
|
|
108
149
|
end
|
|
109
150
|
end
|
|
110
151
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
before
|
|
4
|
+
before do
|
|
5
5
|
subject.add_role "staff".send(param_method)
|
|
6
6
|
end
|
|
7
7
|
|
|
@@ -20,7 +20,7 @@ shared_examples_for "#has_any_role?_examples" do |param_name, param_method|
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
context "with a class scoped role", :scope => :class do
|
|
23
|
-
before
|
|
23
|
+
before do
|
|
24
24
|
subject.add_role "player".send(param_method), Forum
|
|
25
25
|
subject.add_role "superhero".send(param_method)
|
|
26
26
|
end
|
|
@@ -40,7 +40,7 @@ shared_examples_for "#has_any_role?_examples" do |param_name, param_method|
|
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
context "with a instance scoped role", :scope => :instance do
|
|
43
|
-
before
|
|
43
|
+
before do
|
|
44
44
|
subject.add_role "visitor".send(param_method), Forum.last
|
|
45
45
|
subject.add_role "leader", Group
|
|
46
46
|
subject.add_role "warrior"
|
|
@@ -36,7 +36,7 @@ shared_examples_for "#only_has_role?_examples" do |param_name, param_method|
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
context "with multiple roles" do
|
|
39
|
-
before
|
|
39
|
+
before { subject.add_role "multiple_global_roles".send(param_method) }
|
|
40
40
|
|
|
41
41
|
it { subject.only_has_role?("global_role".send(param_method)).should be_false }
|
|
42
42
|
end
|
|
@@ -93,7 +93,7 @@ shared_examples_for "#only_has_role?_examples" do |param_name, param_method|
|
|
|
93
93
|
end
|
|
94
94
|
|
|
95
95
|
context "with multiple roles" do
|
|
96
|
-
before
|
|
96
|
+
before { subject.add_role "multiple_class_roles".send(param_method) }
|
|
97
97
|
|
|
98
98
|
it { subject.only_has_role?("class_role".send(param_method), Forum).should be_false }
|
|
99
99
|
it { subject.only_has_role?("class_role".send(param_method), Forum.first).should be_false }
|
|
@@ -164,7 +164,7 @@ shared_examples_for "#only_has_role?_examples" do |param_name, param_method|
|
|
|
164
164
|
end
|
|
165
165
|
|
|
166
166
|
context "with multiple roles" do
|
|
167
|
-
before
|
|
167
|
+
before { subject.add_role "multiple_instance_roles".send(param_method), Forum.first }
|
|
168
168
|
|
|
169
169
|
it { subject.only_has_role?("instance_role".send(param_method), Forum.first).should be_false }
|
|
170
170
|
it { subject.only_has_role?("instance_role".send(param_method), :any).should be_false }
|
|
@@ -11,13 +11,15 @@ shared_examples_for Rolify::Role do
|
|
|
11
11
|
before(:all) do
|
|
12
12
|
reset_defaults
|
|
13
13
|
Rolify.dynamic_shortcuts = false
|
|
14
|
-
|
|
14
|
+
rolify_options = { :role_cname => role_class.to_s }
|
|
15
|
+
rolify_options[:role_join_table_name] = join_table if defined? join_table
|
|
16
|
+
user_class.rolify rolify_options
|
|
15
17
|
role_class.destroy_all
|
|
16
18
|
Forum.resourcify :roles, :role_cname => role_class.to_s
|
|
17
19
|
Group.resourcify :roles, :role_cname => role_class.to_s
|
|
18
20
|
end
|
|
19
21
|
|
|
20
|
-
context "in the Instance level
|
|
22
|
+
context "in the Instance level" do
|
|
21
23
|
before(:all) do
|
|
22
24
|
admin = user_class.first
|
|
23
25
|
admin.add_role :admin
|
|
@@ -82,7 +84,7 @@ shared_examples_for Rolify::Role do
|
|
|
82
84
|
context "with a new instance" do
|
|
83
85
|
let(:user) { user_class.new }
|
|
84
86
|
|
|
85
|
-
before
|
|
87
|
+
before do
|
|
86
88
|
user.add_role :admin
|
|
87
89
|
user.add_role :moderator, Forum.first
|
|
88
90
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require "rolify/shared_contexts"
|
|
2
2
|
|
|
3
|
-
shared_examples_for "Role.scopes" do
|
|
4
|
-
before
|
|
3
|
+
shared_examples_for "Role.scopes" do
|
|
4
|
+
before do
|
|
5
5
|
role_class.destroy_all
|
|
6
6
|
end
|
|
7
7
|
|
|
@@ -18,9 +18,9 @@ shared_examples_for "Role.scopes" do |param_name, param_method|
|
|
|
18
18
|
let!(:manager_role) { subject.add_role :manager, Group }
|
|
19
19
|
let!(:moderator_role) { subject.add_role :moderator, Forum }
|
|
20
20
|
|
|
21
|
-
it { subject.roles.class_scoped.should
|
|
22
|
-
it { subject.roles.class_scoped(Group).should
|
|
23
|
-
it { subject.roles.class_scoped(Forum).should
|
|
21
|
+
it { subject.roles.class_scoped.should =~ [ manager_role, moderator_role ] }
|
|
22
|
+
it { subject.roles.class_scoped(Group).should =~ [ manager_role ] }
|
|
23
|
+
it { subject.roles.class_scoped(Forum).should =~ [ moderator_role ] }
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
describe ".instance_scoped" do
|
|
@@ -28,11 +28,11 @@ shared_examples_for "Role.scopes" do |param_name, param_method|
|
|
|
28
28
|
let!(:zombie_role) { subject.add_role :visitor, Forum.last }
|
|
29
29
|
let!(:anonymous_role) { subject.add_role :anonymous, Group.last }
|
|
30
30
|
|
|
31
|
-
it { subject.roles.instance_scoped.
|
|
32
|
-
it { subject.roles.instance_scoped(Forum).should
|
|
33
|
-
it { subject.roles.instance_scoped(Forum.first).should
|
|
34
|
-
it { subject.roles.instance_scoped(Forum.last).should
|
|
35
|
-
it { subject.roles.instance_scoped(Group.last).should
|
|
31
|
+
it { subject.roles.instance_scoped.to_a.entries.should =~ [ visitor_role, zombie_role, anonymous_role ] }
|
|
32
|
+
it { subject.roles.instance_scoped(Forum).should =~ [ visitor_role, zombie_role ] }
|
|
33
|
+
it { subject.roles.instance_scoped(Forum.first).should =~ [ visitor_role ] }
|
|
34
|
+
it { subject.roles.instance_scoped(Forum.last).should =~ [ zombie_role ] }
|
|
35
|
+
it { subject.roles.instance_scoped(Group.last).should =~ [ anonymous_role ] }
|
|
36
36
|
it { subject.roles.instance_scoped(Group.first).should be_empty }
|
|
37
37
|
end
|
|
38
38
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -43,11 +43,11 @@ module Admin
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
class Moderator < ActiveRecord::Base
|
|
46
|
-
rolify :role_cname => "Admin::Right"
|
|
46
|
+
rolify :role_cname => "Admin::Right", :role_join_table_name => "moderators_rights"
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
class Right < ActiveRecord::Base
|
|
50
|
-
has_and_belongs_to_many :moderators, :class_name => "Admin::Moderator"
|
|
50
|
+
has_and_belongs_to_many :moderators, :class_name => "Admin::Moderator", :join_table => "moderators_rights"
|
|
51
51
|
belongs_to :resource, :polymorphic => true
|
|
52
52
|
|
|
53
53
|
extend Rolify::Adapter::Scopes
|
|
@@ -66,4 +66,11 @@ class Group < ActiveRecord::Base
|
|
|
66
66
|
def subgroups
|
|
67
67
|
Group.where(:parent_id => id)
|
|
68
68
|
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
class Team < ActiveRecord::Base
|
|
72
|
+
#resourcify done during specs setup to be able to use custom user classes
|
|
73
|
+
self.primary_key = "team_code"
|
|
74
|
+
|
|
75
|
+
default_scope { order(:team_code) }
|
|
69
76
|
end
|
|
@@ -2,10 +2,6 @@ require 'mongoid'
|
|
|
2
2
|
|
|
3
3
|
Mongoid.load!("spec/support/adapters/mongoid.yml", :test)
|
|
4
4
|
|
|
5
|
-
RSpec.configure do |config|
|
|
6
|
-
config.include Mongoid::Matchers
|
|
7
|
-
end
|
|
8
|
-
|
|
9
5
|
::Mongoid::Document.module_eval do
|
|
10
6
|
def self.included(base)
|
|
11
7
|
base.extend Rolify
|
|
@@ -137,3 +133,11 @@ class Group
|
|
|
137
133
|
Group.in(:parent_id => _id)
|
|
138
134
|
end
|
|
139
135
|
end
|
|
136
|
+
|
|
137
|
+
class Team
|
|
138
|
+
include Mongoid::Document
|
|
139
|
+
#resourcify done during specs setup to be able to use custom user classes
|
|
140
|
+
|
|
141
|
+
field :team_code, :type => Integer
|
|
142
|
+
field :name, :type => String
|
|
143
|
+
end
|
data/spec/support/data.rb
CHANGED
data/spec/support/schema.rb
CHANGED
|
@@ -31,7 +31,7 @@ ActiveRecord::Schema.define do
|
|
|
31
31
|
t.references :privilege
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
create_table(:
|
|
34
|
+
create_table(:moderators_rights, :id => false) do |t|
|
|
35
35
|
t.references :moderator
|
|
36
36
|
t.references :right
|
|
37
37
|
end
|
|
@@ -44,4 +44,9 @@ ActiveRecord::Schema.define do
|
|
|
44
44
|
t.integer :parent_id
|
|
45
45
|
t.string :name
|
|
46
46
|
end
|
|
47
|
+
|
|
48
|
+
create_table(:teams, :id => false) do |t|
|
|
49
|
+
t.primary_key :team_code
|
|
50
|
+
t.string :name
|
|
51
|
+
end
|
|
47
52
|
end
|
metadata
CHANGED
|
@@ -1,192 +1,127 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rolify
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.3.0
|
|
5
|
-
prerelease: 6
|
|
4
|
+
version: 3.3.0
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- Florent Monbillard
|
|
9
8
|
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2014-01-26 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
|
-
name:
|
|
14
|
+
name: ammeter
|
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
|
17
|
-
none: false
|
|
18
16
|
requirements:
|
|
19
|
-
- -
|
|
17
|
+
- - ">="
|
|
20
18
|
- !ruby/object:Gem::Version
|
|
21
19
|
version: '0'
|
|
22
20
|
type: :development
|
|
23
21
|
prerelease: false
|
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
-
none: false
|
|
26
23
|
requirements:
|
|
27
|
-
- -
|
|
24
|
+
- - ">="
|
|
28
25
|
- !ruby/object:Gem::Version
|
|
29
26
|
version: '0'
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
|
31
|
-
name:
|
|
28
|
+
name: rake
|
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
|
33
|
-
none: false
|
|
34
30
|
requirements:
|
|
35
|
-
- -
|
|
31
|
+
- - ">="
|
|
36
32
|
- !ruby/object:Gem::Version
|
|
37
33
|
version: '0'
|
|
38
34
|
type: :development
|
|
39
35
|
prerelease: false
|
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
-
none: false
|
|
42
37
|
requirements:
|
|
43
|
-
- -
|
|
38
|
+
- - ">="
|
|
44
39
|
- !ruby/object:Gem::Version
|
|
45
40
|
version: '0'
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
|
47
|
-
name:
|
|
42
|
+
name: rspec
|
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
|
49
|
-
none: false
|
|
50
44
|
requirements:
|
|
51
|
-
- -
|
|
45
|
+
- - ">="
|
|
52
46
|
- !ruby/object:Gem::Version
|
|
53
|
-
version:
|
|
47
|
+
version: '2.0'
|
|
54
48
|
type: :development
|
|
55
49
|
prerelease: false
|
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
-
none: false
|
|
58
51
|
requirements:
|
|
59
|
-
- -
|
|
52
|
+
- - ">="
|
|
60
53
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
54
|
+
version: '2.0'
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
|
63
|
-
name:
|
|
56
|
+
name: rspec-rails
|
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
|
65
|
-
none: false
|
|
66
58
|
requirements:
|
|
67
|
-
- -
|
|
59
|
+
- - ">="
|
|
68
60
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: '
|
|
61
|
+
version: '2.0'
|
|
70
62
|
type: :development
|
|
71
63
|
prerelease: false
|
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
-
none: false
|
|
74
65
|
requirements:
|
|
75
|
-
- -
|
|
66
|
+
- - ">="
|
|
76
67
|
- !ruby/object:Gem::Version
|
|
77
|
-
version: '
|
|
68
|
+
version: '2.0'
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
|
79
|
-
name:
|
|
70
|
+
name: bundler
|
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
|
81
|
-
none: false
|
|
82
72
|
requirements:
|
|
83
|
-
- -
|
|
73
|
+
- - ">="
|
|
84
74
|
- !ruby/object:Gem::Version
|
|
85
75
|
version: '0'
|
|
86
76
|
type: :development
|
|
87
77
|
prerelease: false
|
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
89
|
-
none: false
|
|
90
79
|
requirements:
|
|
91
|
-
- -
|
|
80
|
+
- - ">="
|
|
92
81
|
- !ruby/object:Gem::Version
|
|
93
82
|
version: '0'
|
|
94
83
|
- !ruby/object:Gem::Dependency
|
|
95
|
-
name:
|
|
84
|
+
name: fuubar
|
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
|
97
|
-
none: false
|
|
98
86
|
requirements:
|
|
99
|
-
- -
|
|
87
|
+
- - ">="
|
|
100
88
|
- !ruby/object:Gem::Version
|
|
101
89
|
version: '0'
|
|
102
90
|
type: :development
|
|
103
91
|
prerelease: false
|
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
105
|
-
none: false
|
|
106
93
|
requirements:
|
|
107
|
-
- -
|
|
94
|
+
- - ">="
|
|
108
95
|
- !ruby/object:Gem::Version
|
|
109
96
|
version: '0'
|
|
110
97
|
- !ruby/object:Gem::Dependency
|
|
111
|
-
name:
|
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
|
113
|
-
none: false
|
|
114
|
-
requirements:
|
|
115
|
-
- - ! '>='
|
|
116
|
-
- !ruby/object:Gem::Version
|
|
117
|
-
version: '2.0'
|
|
118
|
-
type: :development
|
|
119
|
-
prerelease: false
|
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
-
none: false
|
|
122
|
-
requirements:
|
|
123
|
-
- - ! '>='
|
|
124
|
-
- !ruby/object:Gem::Version
|
|
125
|
-
version: '2.0'
|
|
126
|
-
- !ruby/object:Gem::Dependency
|
|
127
|
-
name: rspec-rails
|
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
|
129
|
-
none: false
|
|
130
|
-
requirements:
|
|
131
|
-
- - ! '>='
|
|
132
|
-
- !ruby/object:Gem::Version
|
|
133
|
-
version: '2.0'
|
|
134
|
-
type: :development
|
|
135
|
-
prerelease: false
|
|
136
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
137
|
-
none: false
|
|
138
|
-
requirements:
|
|
139
|
-
- - ! '>='
|
|
140
|
-
- !ruby/object:Gem::Version
|
|
141
|
-
version: '2.0'
|
|
142
|
-
- !ruby/object:Gem::Dependency
|
|
143
|
-
name: mongoid-rspec
|
|
144
|
-
requirement: !ruby/object:Gem::Requirement
|
|
145
|
-
none: false
|
|
146
|
-
requirements:
|
|
147
|
-
- - ! '>='
|
|
148
|
-
- !ruby/object:Gem::Version
|
|
149
|
-
version: '1.5'
|
|
150
|
-
type: :development
|
|
151
|
-
prerelease: false
|
|
152
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
153
|
-
none: false
|
|
154
|
-
requirements:
|
|
155
|
-
- - ! '>='
|
|
156
|
-
- !ruby/object:Gem::Version
|
|
157
|
-
version: '1.5'
|
|
158
|
-
- !ruby/object:Gem::Dependency
|
|
159
|
-
name: bundler
|
|
98
|
+
name: activerecord
|
|
160
99
|
requirement: !ruby/object:Gem::Requirement
|
|
161
|
-
none: false
|
|
162
100
|
requirements:
|
|
163
|
-
- -
|
|
101
|
+
- - ">="
|
|
164
102
|
- !ruby/object:Gem::Version
|
|
165
|
-
version:
|
|
103
|
+
version: 3.2.0
|
|
166
104
|
type: :development
|
|
167
105
|
prerelease: false
|
|
168
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
169
|
-
none: false
|
|
170
107
|
requirements:
|
|
171
|
-
- -
|
|
108
|
+
- - ">="
|
|
172
109
|
- !ruby/object:Gem::Version
|
|
173
|
-
version:
|
|
110
|
+
version: 3.2.0
|
|
174
111
|
- !ruby/object:Gem::Dependency
|
|
175
|
-
name:
|
|
112
|
+
name: mongoid
|
|
176
113
|
requirement: !ruby/object:Gem::Requirement
|
|
177
|
-
none: false
|
|
178
114
|
requirements:
|
|
179
|
-
- -
|
|
115
|
+
- - ">="
|
|
180
116
|
- !ruby/object:Gem::Version
|
|
181
|
-
version: '
|
|
117
|
+
version: '3.1'
|
|
182
118
|
type: :development
|
|
183
119
|
prerelease: false
|
|
184
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
185
|
-
none: false
|
|
186
121
|
requirements:
|
|
187
|
-
- -
|
|
122
|
+
- - ">="
|
|
188
123
|
- !ruby/object:Gem::Version
|
|
189
|
-
version: '
|
|
124
|
+
version: '3.1'
|
|
190
125
|
description: Very simple Roles library without any authorization enforcement supporting
|
|
191
126
|
scope on resource objects (instance or class). Supports ActiveRecord and Mongoid
|
|
192
127
|
ORMs.
|
|
@@ -196,14 +131,16 @@ executables: []
|
|
|
196
131
|
extensions: []
|
|
197
132
|
extra_rdoc_files: []
|
|
198
133
|
files:
|
|
199
|
-
- .gitignore
|
|
200
|
-
- .travis.yml
|
|
134
|
+
- ".gitignore"
|
|
135
|
+
- ".travis.yml"
|
|
201
136
|
- CHANGELOG.rdoc
|
|
202
137
|
- Gemfile
|
|
203
138
|
- LICENSE
|
|
204
139
|
- README.md
|
|
205
140
|
- Rakefile
|
|
206
141
|
- UPGRADE.rdoc
|
|
142
|
+
- gemfiles/Gemfile.rails-3.2
|
|
143
|
+
- gemfiles/Gemfile.rails-4.0
|
|
207
144
|
- lib/generators/active_record/rolify_generator.rb
|
|
208
145
|
- lib/generators/active_record/templates/README
|
|
209
146
|
- lib/generators/active_record/templates/migration.rb
|
|
@@ -233,7 +170,9 @@ files:
|
|
|
233
170
|
- lib/rolify/utils.rb
|
|
234
171
|
- lib/rolify/version.rb
|
|
235
172
|
- rolify.gemspec
|
|
236
|
-
- spec/
|
|
173
|
+
- spec/README.rdoc
|
|
174
|
+
- spec/generators/rolify/rolify_activerecord_generator_spec.rb
|
|
175
|
+
- spec/generators/rolify/rolify_mongoid_generator_spec.rb
|
|
237
176
|
- spec/generators_helper.rb
|
|
238
177
|
- spec/rolify/config_spec.rb
|
|
239
178
|
- spec/rolify/custom_spec.rb
|
|
@@ -262,30 +201,31 @@ files:
|
|
|
262
201
|
- spec/support/schema.rb
|
|
263
202
|
homepage: http://eppo.github.com/rolify/
|
|
264
203
|
licenses: []
|
|
204
|
+
metadata: {}
|
|
265
205
|
post_install_message:
|
|
266
206
|
rdoc_options: []
|
|
267
207
|
require_paths:
|
|
268
208
|
- lib
|
|
269
209
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
270
|
-
none: false
|
|
271
210
|
requirements:
|
|
272
|
-
- -
|
|
211
|
+
- - ">="
|
|
273
212
|
- !ruby/object:Gem::Version
|
|
274
213
|
version: '0'
|
|
275
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
276
|
-
none: false
|
|
277
215
|
requirements:
|
|
278
|
-
- -
|
|
216
|
+
- - ">="
|
|
279
217
|
- !ruby/object:Gem::Version
|
|
280
|
-
version:
|
|
218
|
+
version: '0'
|
|
281
219
|
requirements: []
|
|
282
220
|
rubyforge_project: rolify
|
|
283
|
-
rubygems_version:
|
|
221
|
+
rubygems_version: 2.0.3
|
|
284
222
|
signing_key:
|
|
285
|
-
specification_version:
|
|
223
|
+
specification_version: 4
|
|
286
224
|
summary: Roles library with resource scoping
|
|
287
225
|
test_files:
|
|
288
|
-
- spec/
|
|
226
|
+
- spec/README.rdoc
|
|
227
|
+
- spec/generators/rolify/rolify_activerecord_generator_spec.rb
|
|
228
|
+
- spec/generators/rolify/rolify_mongoid_generator_spec.rb
|
|
289
229
|
- spec/generators_helper.rb
|
|
290
230
|
- spec/rolify/config_spec.rb
|
|
291
231
|
- spec/rolify/custom_spec.rb
|
|
@@ -312,3 +252,4 @@ test_files:
|
|
|
312
252
|
- spec/support/adapters/mongoid.yml
|
|
313
253
|
- spec/support/data.rb
|
|
314
254
|
- spec/support/schema.rb
|
|
255
|
+
has_rdoc:
|