g5_authenticatable 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +12 -0
- data/CHANGELOG.md +11 -0
- data/Gemfile +2 -2
- data/README.md +186 -1
- data/app/controllers/concerns/g5_authenticatable/authorization.rb +21 -0
- data/app/models/g5_authenticatable/role.rb +8 -0
- data/app/models/g5_authenticatable/user.rb +41 -0
- data/app/policies/g5_authenticatable/base_policy.rb +73 -0
- data/config/initializers/rolify.rb +8 -0
- data/g5_authenticatable.gemspec +3 -0
- data/lib/g5_authenticatable/engine.rb +3 -0
- data/lib/g5_authenticatable/rspec.rb +1 -0
- data/lib/g5_authenticatable/test/factory.rb +51 -1
- data/lib/g5_authenticatable/test/feature_helpers.rb +15 -2
- data/lib/g5_authenticatable/version.rb +1 -1
- data/lib/generators/g5_authenticatable/install/USAGE +7 -1
- data/lib/generators/g5_authenticatable/install/install_generator.rb +33 -6
- data/lib/generators/g5_authenticatable/install/templates/403.html +26 -0
- data/lib/generators/g5_authenticatable/install/templates/application_policy.rb +4 -0
- data/lib/generators/g5_authenticatable/install/templates/{g5_authenticatable.rb → initializer.rb} +0 -0
- data/lib/generators/g5_authenticatable/install/templates/migrate/add_g5_authenticatable_users_contact_info.rb +11 -0
- data/lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb +20 -0
- data/lib/generators/g5_authenticatable/install/templates/{create_g5_authenticatable_users.rb → migrate/create_g5_authenticatable_users.rb} +0 -0
- data/spec/controllers/application_controller_spec.rb +12 -0
- data/spec/controllers/concerns/g5_authenticatable/authorization.rb +50 -0
- data/spec/dummy/app/assets/javascripts/posts.js +2 -0
- data/spec/dummy/app/assets/stylesheets/posts.css +4 -0
- data/spec/dummy/app/assets/stylesheets/scaffold.css +56 -0
- data/spec/dummy/app/controllers/application_controller.rb +1 -0
- data/spec/dummy/app/controllers/posts_controller.rb +74 -0
- data/spec/dummy/app/helpers/posts_helper.rb +2 -0
- data/spec/dummy/app/models/post.rb +3 -0
- data/spec/dummy/app/policies/application_policy.rb +4 -0
- data/spec/dummy/app/policies/post_policy.rb +4 -0
- data/spec/dummy/app/views/home/index.html.erb +40 -0
- data/spec/dummy/app/views/posts/_form.html.erb +21 -0
- data/spec/dummy/app/views/posts/edit.html.erb +6 -0
- data/spec/dummy/app/views/posts/index.html.erb +30 -0
- data/spec/dummy/app/views/posts/new.html.erb +5 -0
- data/spec/dummy/app/views/posts/show.html.erb +17 -0
- data/spec/dummy/config/database.yml.ci +1 -2
- data/spec/dummy/config/initializers/g5_authenticatable.rb +8 -0
- data/spec/dummy/config/routes.rb +2 -0
- data/spec/dummy/db/migrate/20150428182339_add_g5_authenticatable_users_contact_info.rb +11 -0
- data/spec/dummy/db/migrate/20150429212919_create_g5_authenticatable_roles.rb +20 -0
- data/spec/dummy/db/migrate/20150509061150_create_posts.rb +9 -0
- data/spec/dummy/db/schema.rb +37 -4
- data/spec/dummy/public/403.html +26 -0
- data/spec/factories/post.rb +6 -0
- data/spec/features/default_role_authorization_spec.rb +254 -0
- data/spec/features/sign_in_spec.rb +144 -8
- data/spec/lib/generators/g5_authenticatable/install_generator_spec.rb +72 -1
- data/spec/models/g5_authenticatable/role_spec.rb +81 -0
- data/spec/models/g5_authenticatable/user_spec.rb +340 -3
- data/spec/models/post_spec.rb +12 -0
- data/spec/policies/application_policy_spec.rb +171 -0
- data/spec/policies/post_policy_spec.rb +35 -0
- data/spec/requests/default_role_authorization_spec.rb +169 -0
- data/spec/spec_helper.rb +0 -3
- data/spec/support/shared_examples/super_admin_authorizer.rb +33 -0
- metadata +109 -5
- data/circle.yml +0 -4
@@ -0,0 +1,169 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Default role-based authorization API' do
|
4
|
+
let(:json) { JSON.parse(response.body) }
|
5
|
+
|
6
|
+
describe 'GET /posts', :auth_request do
|
7
|
+
subject(:get_posts) { get posts_path, format: :json }
|
8
|
+
|
9
|
+
let!(:post) { FactoryGirl.create(:post, author: user) }
|
10
|
+
let!(:other_post) { FactoryGirl.create(:post) }
|
11
|
+
|
12
|
+
before { get_posts }
|
13
|
+
|
14
|
+
context 'when user is a super_admin' do
|
15
|
+
let(:user) { FactoryGirl.create(:g5_authenticatable_super_admin) }
|
16
|
+
|
17
|
+
it 'returns ok' do
|
18
|
+
expect(response).to be_ok
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'includes all posts' do
|
22
|
+
expect(json).to contain_exactly(
|
23
|
+
hash_including('id' => post.id,
|
24
|
+
'author_id' => post.author.id,
|
25
|
+
'content' => post.content),
|
26
|
+
hash_including('id' => other_post.id,
|
27
|
+
'author_id' => other_post.author.id,
|
28
|
+
'content' => other_post.content)
|
29
|
+
)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context 'when user is not a super_admin' do
|
34
|
+
it 'returns forbidden' do
|
35
|
+
expect(response).to be_forbidden
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe 'GET /posts/:id', :auth_request do
|
41
|
+
subject(:show_post) { get post_path(post.id), format: :json }
|
42
|
+
|
43
|
+
let(:post) { FactoryGirl.create(:post, author: user) }
|
44
|
+
|
45
|
+
before { show_post }
|
46
|
+
|
47
|
+
context 'when user is a super_admin' do
|
48
|
+
let(:user) { FactoryGirl.create(:g5_authenticatable_super_admin) }
|
49
|
+
|
50
|
+
it 'returns ok' do
|
51
|
+
expect(response).to be_ok
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'returns the post' do
|
55
|
+
expect(json).to include('id' => post.id,
|
56
|
+
'author_id' => post.author.id,
|
57
|
+
'content' => post.content)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
context 'when user is not a super_admin' do
|
62
|
+
let(:user) { FactoryGirl.create(:g5_authenticatable_user) }
|
63
|
+
|
64
|
+
it 'returns forbidden' do
|
65
|
+
expect(response).to be_forbidden
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe 'POST /posts', :auth_request do
|
71
|
+
subject(:create_post) { post posts_path, post: post_params, format: :json }
|
72
|
+
|
73
|
+
let(:post_params) do
|
74
|
+
{content: post_obj.content, author_id: post_obj.author.id}
|
75
|
+
end
|
76
|
+
let(:post_obj) { FactoryGirl.build(:post, author: user) }
|
77
|
+
|
78
|
+
context 'when user is a super_admin' do
|
79
|
+
let(:user) { FactoryGirl.create(:g5_authenticatable_super_admin) }
|
80
|
+
|
81
|
+
it 'returns ok' do
|
82
|
+
create_post
|
83
|
+
expect(response).to be_created
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'creates a post' do
|
87
|
+
expect { create_post }.to change { Post.count }.by(1)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
context 'when user is not a super_admin' do
|
92
|
+
it 'returns forbidden' do
|
93
|
+
create_post
|
94
|
+
expect(response).to be_forbidden
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'does not create a post' do
|
98
|
+
expect { create_post }.to_not change { Post.count }
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
describe 'PUT /posts/:id', :auth_request do
|
104
|
+
subject(:update_post) do
|
105
|
+
put post_path(post.id), post: post_params, format: :json
|
106
|
+
end
|
107
|
+
|
108
|
+
let(:post_params) do
|
109
|
+
{content: 'some brand new content', author_id: post.author.id}
|
110
|
+
end
|
111
|
+
let(:post) { FactoryGirl.create(:post, author: user) }
|
112
|
+
|
113
|
+
context 'when user is a super_admin' do
|
114
|
+
let(:user) { FactoryGirl.create(:g5_authenticatable_super_admin) }
|
115
|
+
|
116
|
+
it 'returns ok' do
|
117
|
+
update_post
|
118
|
+
expect(response).to be_http_no_content
|
119
|
+
end
|
120
|
+
|
121
|
+
it 'updates the post' do
|
122
|
+
expect { update_post }.to change { post.reload.content }
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
context 'when user is not a super_admin' do
|
127
|
+
it 'returns forbidden' do
|
128
|
+
update_post
|
129
|
+
expect(response).to be_forbidden
|
130
|
+
end
|
131
|
+
|
132
|
+
it 'does not update the post' do
|
133
|
+
expect { update_post }.to_not change { post.reload.content }
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
describe 'DELETE /posts/:id', :auth_request do
|
139
|
+
subject(:delete_post) do
|
140
|
+
delete post_path(post.id), format: :json
|
141
|
+
end
|
142
|
+
|
143
|
+
let!(:post) { FactoryGirl.create(:post, author: user) }
|
144
|
+
|
145
|
+
context 'when user is a super_admin' do
|
146
|
+
let(:user) { FactoryGirl.create(:g5_authenticatable_super_admin) }
|
147
|
+
|
148
|
+
it 'returns ok' do
|
149
|
+
delete_post
|
150
|
+
expect(response).to be_http_no_content
|
151
|
+
end
|
152
|
+
|
153
|
+
it 'deletes the post' do
|
154
|
+
expect { delete_post }.to change { Post.count }.by(-1)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
context 'when user is not a super_admin' do
|
159
|
+
it 'returns forbidden' do
|
160
|
+
delete_post
|
161
|
+
expect(response).to be_forbidden
|
162
|
+
end
|
163
|
+
|
164
|
+
it 'does not delete the post' do
|
165
|
+
expect { delete_post }.to_not change { Post.count }
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -9,7 +9,6 @@ ENV["RAILS_ENV"] ||= 'test'
|
|
9
9
|
require File.expand_path("../dummy/config/environment", __FILE__)
|
10
10
|
|
11
11
|
require 'rspec/rails'
|
12
|
-
require 'rspec/autorun'
|
13
12
|
require 'capybara/rspec'
|
14
13
|
require 'webmock/rspec'
|
15
14
|
require 'g5_authenticatable/rspec'
|
@@ -46,8 +45,6 @@ RSpec.configure do |config|
|
|
46
45
|
# --seed 1234
|
47
46
|
config.order = 'random'
|
48
47
|
|
49
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
50
|
-
|
51
48
|
config.infer_spec_type_from_file_location!
|
52
49
|
|
53
50
|
config.after(:suite) { WebMock.disable! }
|
@@ -0,0 +1,33 @@
|
|
1
|
+
shared_examples_for 'a super_admin authorizer' do
|
2
|
+
context 'when user is an admin' do
|
3
|
+
let(:user) { FactoryGirl.create(:g5_authenticatable_admin) }
|
4
|
+
|
5
|
+
it 'denies access' do
|
6
|
+
expect(policy).to_not permit(user, record)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
context 'when user is an editor' do
|
11
|
+
let(:user) { FactoryGirl.create(:g5_authenticatable_editor) }
|
12
|
+
|
13
|
+
it 'denies access' do
|
14
|
+
expect(policy).to_not permit(user, record)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'when user is a viewer' do
|
19
|
+
let(:user) { FactoryGirl.create(:g5_authenticatable_user) }
|
20
|
+
|
21
|
+
it 'denies access' do
|
22
|
+
expect(policy).to_not permit(user, record)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'when user has super_admin role' do
|
27
|
+
let(:user) { FactoryGirl.create(:g5_authenticatable_super_admin) }
|
28
|
+
|
29
|
+
it 'permits access' do
|
30
|
+
expect(policy).to permit(user, record)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: g5_authenticatable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- maeve
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: devise_g5_authenticatable
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: omniauth-g5
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.2'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: g5_authenticatable_api
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,6 +52,34 @@ dependencies:
|
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: 0.3.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rolify
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '4.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pundit
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.0'
|
41
83
|
description: |-
|
42
84
|
An engine that provides a basic User model,
|
43
85
|
authentication logic, and remote credential
|
@@ -52,6 +94,7 @@ files:
|
|
52
94
|
- ".gitignore"
|
53
95
|
- ".rspec"
|
54
96
|
- ".ruby-version"
|
97
|
+
- ".travis.yml"
|
55
98
|
- CHANGELOG.md
|
56
99
|
- Gemfile
|
57
100
|
- LICENSE
|
@@ -60,16 +103,19 @@ files:
|
|
60
103
|
- app/assets/images/g5_authenticatable/.gitkeep
|
61
104
|
- app/assets/javascripts/g5_authenticatable/application.js
|
62
105
|
- app/assets/stylesheets/g5_authenticatable/application.css
|
106
|
+
- app/controllers/concerns/g5_authenticatable/authorization.rb
|
63
107
|
- app/controllers/g5_authenticatable/application_controller.rb
|
64
108
|
- app/controllers/g5_authenticatable/error_controller.rb
|
65
109
|
- app/controllers/g5_authenticatable/failure_app.rb
|
66
110
|
- app/controllers/g5_authenticatable/sessions_controller.rb
|
67
111
|
- app/helpers/g5_authenticatable/application_helper.rb
|
112
|
+
- app/models/g5_authenticatable/role.rb
|
68
113
|
- app/models/g5_authenticatable/user.rb
|
114
|
+
- app/policies/g5_authenticatable/base_policy.rb
|
69
115
|
- app/views/g5_authenticatable/error/auth_error.html.erb
|
70
116
|
- app/views/layouts/g5_authenticatable/application.html.erb
|
71
|
-
- circle.yml
|
72
117
|
- config/initializers/devise.rb
|
118
|
+
- config/initializers/rolify.rb
|
73
119
|
- config/locales/devise.en.yml
|
74
120
|
- config/routes.rb
|
75
121
|
- g5_authenticatable.gemspec
|
@@ -85,27 +131,45 @@ files:
|
|
85
131
|
- lib/g5_authenticatable/version.rb
|
86
132
|
- lib/generators/g5_authenticatable/install/USAGE
|
87
133
|
- lib/generators/g5_authenticatable/install/install_generator.rb
|
88
|
-
- lib/generators/g5_authenticatable/install/templates/
|
89
|
-
- lib/generators/g5_authenticatable/install/templates/
|
134
|
+
- lib/generators/g5_authenticatable/install/templates/403.html
|
135
|
+
- lib/generators/g5_authenticatable/install/templates/application_policy.rb
|
136
|
+
- lib/generators/g5_authenticatable/install/templates/initializer.rb
|
137
|
+
- lib/generators/g5_authenticatable/install/templates/migrate/add_g5_authenticatable_users_contact_info.rb
|
138
|
+
- lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_roles.rb
|
139
|
+
- lib/generators/g5_authenticatable/install/templates/migrate/create_g5_authenticatable_users.rb
|
90
140
|
- lib/tasks/g5_authenticatable/purge_users.rake
|
91
141
|
- script/rails
|
92
142
|
- spec/config/application_spec.rb
|
93
143
|
- spec/controllers/.gitkeep
|
94
144
|
- spec/controllers/application_controller_spec.rb
|
145
|
+
- spec/controllers/concerns/g5_authenticatable/authorization.rb
|
95
146
|
- spec/dummy/README.rdoc
|
96
147
|
- spec/dummy/Rakefile
|
97
148
|
- spec/dummy/app/api/secure_api.rb
|
98
149
|
- spec/dummy/app/assets/javascripts/application.js
|
150
|
+
- spec/dummy/app/assets/javascripts/posts.js
|
99
151
|
- spec/dummy/app/assets/stylesheets/application.css
|
152
|
+
- spec/dummy/app/assets/stylesheets/posts.css
|
153
|
+
- spec/dummy/app/assets/stylesheets/scaffold.css
|
100
154
|
- spec/dummy/app/controllers/application_controller.rb
|
101
155
|
- spec/dummy/app/controllers/home_controller.rb
|
156
|
+
- spec/dummy/app/controllers/posts_controller.rb
|
102
157
|
- spec/dummy/app/controllers/rails_api/secure_resources_controller.rb
|
103
158
|
- spec/dummy/app/helpers/application_helper.rb
|
159
|
+
- spec/dummy/app/helpers/posts_helper.rb
|
104
160
|
- spec/dummy/app/mailers/.gitkeep
|
105
161
|
- spec/dummy/app/models/.gitkeep
|
162
|
+
- spec/dummy/app/models/post.rb
|
163
|
+
- spec/dummy/app/policies/application_policy.rb
|
164
|
+
- spec/dummy/app/policies/post_policy.rb
|
106
165
|
- spec/dummy/app/views/home/index.html.erb
|
107
166
|
- spec/dummy/app/views/home/show.html.erb
|
108
167
|
- spec/dummy/app/views/layouts/application.html.erb
|
168
|
+
- spec/dummy/app/views/posts/_form.html.erb
|
169
|
+
- spec/dummy/app/views/posts/edit.html.erb
|
170
|
+
- spec/dummy/app/views/posts/index.html.erb
|
171
|
+
- spec/dummy/app/views/posts/new.html.erb
|
172
|
+
- spec/dummy/app/views/posts/show.html.erb
|
109
173
|
- spec/dummy/app/views/rails_api/secure_resources/show.html.erb
|
110
174
|
- spec/dummy/config.ru
|
111
175
|
- spec/dummy/config/application.rb
|
@@ -117,6 +181,7 @@ files:
|
|
117
181
|
- spec/dummy/config/environments/production.rb
|
118
182
|
- spec/dummy/config/environments/test.rb
|
119
183
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
184
|
+
- spec/dummy/config/initializers/g5_authenticatable.rb
|
120
185
|
- spec/dummy/config/initializers/inflections.rb
|
121
186
|
- spec/dummy/config/initializers/mime_types.rb
|
122
187
|
- spec/dummy/config/initializers/secret_token.rb
|
@@ -125,21 +190,32 @@ files:
|
|
125
190
|
- spec/dummy/config/locales/en.yml
|
126
191
|
- spec/dummy/config/routes.rb
|
127
192
|
- spec/dummy/db/migrate/20140206070137_create_g5_authenticatable_users.rb
|
193
|
+
- spec/dummy/db/migrate/20150428182339_add_g5_authenticatable_users_contact_info.rb
|
194
|
+
- spec/dummy/db/migrate/20150429212919_create_g5_authenticatable_roles.rb
|
195
|
+
- spec/dummy/db/migrate/20150509061150_create_posts.rb
|
128
196
|
- spec/dummy/db/schema.rb
|
129
197
|
- spec/dummy/lib/assets/.gitkeep
|
130
198
|
- spec/dummy/log/.gitkeep
|
199
|
+
- spec/dummy/public/403.html
|
131
200
|
- spec/dummy/public/404.html
|
132
201
|
- spec/dummy/public/422.html
|
133
202
|
- spec/dummy/public/500.html
|
134
203
|
- spec/dummy/public/favicon.ico
|
135
204
|
- spec/dummy/script/rails
|
205
|
+
- spec/factories/post.rb
|
136
206
|
- spec/features/auth_error_path_spec.rb
|
207
|
+
- spec/features/default_role_authorization_spec.rb
|
137
208
|
- spec/features/sign_in_spec.rb
|
138
209
|
- spec/features/token_validation_spec.rb
|
139
210
|
- spec/g5_authenticatable/version_spec.rb
|
140
211
|
- spec/lib/generators/g5_authenticatable/install_generator_spec.rb
|
141
212
|
- spec/models/.gitkeep
|
213
|
+
- spec/models/g5_authenticatable/role_spec.rb
|
142
214
|
- spec/models/g5_authenticatable/user_spec.rb
|
215
|
+
- spec/models/post_spec.rb
|
216
|
+
- spec/policies/application_policy_spec.rb
|
217
|
+
- spec/policies/post_policy_spec.rb
|
218
|
+
- spec/requests/default_role_authorization_spec.rb
|
143
219
|
- spec/requests/grape_api_spec.rb
|
144
220
|
- spec/requests/rails_api_spec.rb
|
145
221
|
- spec/requests/sign_out_spec.rb
|
@@ -149,6 +225,7 @@ files:
|
|
149
225
|
- spec/spec_helper.rb
|
150
226
|
- spec/support/devise.rb
|
151
227
|
- spec/support/shared_contexts/rake.rb
|
228
|
+
- spec/support/shared_examples/super_admin_authorizer.rb
|
152
229
|
- spec/support/token_validation.rb
|
153
230
|
- spec/tasks/purge_users_spec.rb
|
154
231
|
homepage: https://github.com/G5/g5_authenticatable
|
@@ -179,20 +256,34 @@ test_files:
|
|
179
256
|
- spec/config/application_spec.rb
|
180
257
|
- spec/controllers/.gitkeep
|
181
258
|
- spec/controllers/application_controller_spec.rb
|
259
|
+
- spec/controllers/concerns/g5_authenticatable/authorization.rb
|
182
260
|
- spec/dummy/README.rdoc
|
183
261
|
- spec/dummy/Rakefile
|
184
262
|
- spec/dummy/app/api/secure_api.rb
|
185
263
|
- spec/dummy/app/assets/javascripts/application.js
|
264
|
+
- spec/dummy/app/assets/javascripts/posts.js
|
186
265
|
- spec/dummy/app/assets/stylesheets/application.css
|
266
|
+
- spec/dummy/app/assets/stylesheets/posts.css
|
267
|
+
- spec/dummy/app/assets/stylesheets/scaffold.css
|
187
268
|
- spec/dummy/app/controllers/application_controller.rb
|
188
269
|
- spec/dummy/app/controllers/home_controller.rb
|
270
|
+
- spec/dummy/app/controllers/posts_controller.rb
|
189
271
|
- spec/dummy/app/controllers/rails_api/secure_resources_controller.rb
|
190
272
|
- spec/dummy/app/helpers/application_helper.rb
|
273
|
+
- spec/dummy/app/helpers/posts_helper.rb
|
191
274
|
- spec/dummy/app/mailers/.gitkeep
|
192
275
|
- spec/dummy/app/models/.gitkeep
|
276
|
+
- spec/dummy/app/models/post.rb
|
277
|
+
- spec/dummy/app/policies/application_policy.rb
|
278
|
+
- spec/dummy/app/policies/post_policy.rb
|
193
279
|
- spec/dummy/app/views/home/index.html.erb
|
194
280
|
- spec/dummy/app/views/home/show.html.erb
|
195
281
|
- spec/dummy/app/views/layouts/application.html.erb
|
282
|
+
- spec/dummy/app/views/posts/_form.html.erb
|
283
|
+
- spec/dummy/app/views/posts/edit.html.erb
|
284
|
+
- spec/dummy/app/views/posts/index.html.erb
|
285
|
+
- spec/dummy/app/views/posts/new.html.erb
|
286
|
+
- spec/dummy/app/views/posts/show.html.erb
|
196
287
|
- spec/dummy/app/views/rails_api/secure_resources/show.html.erb
|
197
288
|
- spec/dummy/config.ru
|
198
289
|
- spec/dummy/config/application.rb
|
@@ -204,6 +295,7 @@ test_files:
|
|
204
295
|
- spec/dummy/config/environments/production.rb
|
205
296
|
- spec/dummy/config/environments/test.rb
|
206
297
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
298
|
+
- spec/dummy/config/initializers/g5_authenticatable.rb
|
207
299
|
- spec/dummy/config/initializers/inflections.rb
|
208
300
|
- spec/dummy/config/initializers/mime_types.rb
|
209
301
|
- spec/dummy/config/initializers/secret_token.rb
|
@@ -212,21 +304,32 @@ test_files:
|
|
212
304
|
- spec/dummy/config/locales/en.yml
|
213
305
|
- spec/dummy/config/routes.rb
|
214
306
|
- spec/dummy/db/migrate/20140206070137_create_g5_authenticatable_users.rb
|
307
|
+
- spec/dummy/db/migrate/20150428182339_add_g5_authenticatable_users_contact_info.rb
|
308
|
+
- spec/dummy/db/migrate/20150429212919_create_g5_authenticatable_roles.rb
|
309
|
+
- spec/dummy/db/migrate/20150509061150_create_posts.rb
|
215
310
|
- spec/dummy/db/schema.rb
|
216
311
|
- spec/dummy/lib/assets/.gitkeep
|
217
312
|
- spec/dummy/log/.gitkeep
|
313
|
+
- spec/dummy/public/403.html
|
218
314
|
- spec/dummy/public/404.html
|
219
315
|
- spec/dummy/public/422.html
|
220
316
|
- spec/dummy/public/500.html
|
221
317
|
- spec/dummy/public/favicon.ico
|
222
318
|
- spec/dummy/script/rails
|
319
|
+
- spec/factories/post.rb
|
223
320
|
- spec/features/auth_error_path_spec.rb
|
321
|
+
- spec/features/default_role_authorization_spec.rb
|
224
322
|
- spec/features/sign_in_spec.rb
|
225
323
|
- spec/features/token_validation_spec.rb
|
226
324
|
- spec/g5_authenticatable/version_spec.rb
|
227
325
|
- spec/lib/generators/g5_authenticatable/install_generator_spec.rb
|
228
326
|
- spec/models/.gitkeep
|
327
|
+
- spec/models/g5_authenticatable/role_spec.rb
|
229
328
|
- spec/models/g5_authenticatable/user_spec.rb
|
329
|
+
- spec/models/post_spec.rb
|
330
|
+
- spec/policies/application_policy_spec.rb
|
331
|
+
- spec/policies/post_policy_spec.rb
|
332
|
+
- spec/requests/default_role_authorization_spec.rb
|
230
333
|
- spec/requests/grape_api_spec.rb
|
231
334
|
- spec/requests/rails_api_spec.rb
|
232
335
|
- spec/requests/sign_out_spec.rb
|
@@ -236,5 +339,6 @@ test_files:
|
|
236
339
|
- spec/spec_helper.rb
|
237
340
|
- spec/support/devise.rb
|
238
341
|
- spec/support/shared_contexts/rake.rb
|
342
|
+
- spec/support/shared_examples/super_admin_authorizer.rb
|
239
343
|
- spec/support/token_validation.rb
|
240
344
|
- spec/tasks/purge_users_spec.rb
|
data/circle.yml
DELETED