devise_masquerade 0.6.5 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/FUNDING.yml +1 -0
- data/.github/workflows/brakeman-analysis.yml +44 -0
- data/.github/workflows/rubocop-analysis.yml +39 -0
- data/.gitignore +1 -2
- data/.ruby-version +1 -1
- data/.travis.yml +2 -7
- data/Gemfile +16 -10
- data/Gemfile.lock +310 -0
- data/Makefile +6 -1
- data/README.md +57 -12
- data/app/controllers/devise/masquerades_controller.rb +119 -70
- data/devise_masquerade.gemspec +5 -4
- data/features/back.feature +15 -1
- data/features/expires_masquerade.feature +36 -0
- data/features/multiple_masquerading_models.feature +17 -0
- data/features/step_definitions/auth_steps.rb +8 -0
- data/features/step_definitions/back_steps.rb +22 -3
- data/features/step_definitions/expires_steps.rb +9 -0
- data/features/step_definitions/url_helpers_steps.rb +11 -0
- data/features/support/env.rb +23 -4
- data/features/url_helpers.feature +14 -0
- data/lib/devise_masquerade/controllers/helpers.rb +90 -9
- data/lib/devise_masquerade/controllers/url_helpers.rb +16 -2
- data/lib/devise_masquerade/models/masqueradable.rb +13 -0
- data/lib/devise_masquerade/models.rb +9 -0
- data/lib/devise_masquerade/rails.rb +14 -4
- data/lib/devise_masquerade/routes.rb +11 -8
- data/lib/devise_masquerade/version.rb +1 -1
- data/lib/devise_masquerade.rb +23 -9
- data/spec/controllers/admin/dashboard_controller_spec.rb +3 -4
- data/spec/controllers/dashboard_controller_spec.rb +3 -5
- data/spec/controllers/devise/masquerades_controller_spec.rb +80 -38
- data/spec/controllers/masquerades_tests_controller_spec.rb +57 -0
- data/spec/dummy/app/controllers/admin/dashboard_controller.rb +1 -2
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/controllers/dashboard_controller.rb +5 -2
- data/spec/dummy/app/controllers/masquerades_tests_controller.rb +7 -0
- data/spec/dummy/app/controllers/students_controller.rb +8 -0
- data/spec/dummy/app/models/admin/user.rb +0 -7
- data/spec/dummy/app/models/student.rb +3 -0
- data/spec/dummy/app/models/user.rb +1 -10
- data/spec/dummy/app/views/admin/dashboard/index.html.erb +0 -2
- data/spec/dummy/app/views/dashboard/extra_params.html.erb +7 -0
- data/spec/dummy/app/views/dashboard/index.html.erb +0 -2
- data/spec/dummy/app/views/layouts/application.html.erb +10 -2
- data/spec/dummy/app/views/students/_student.html.erb +6 -0
- data/spec/dummy/app/views/students/index.html.erb +1 -0
- data/spec/dummy/app/views/users/_user.html.erb +1 -1
- data/spec/dummy/config/application.rb +2 -0
- data/spec/dummy/config/environment.rb +1 -0
- data/spec/dummy/config/routes.rb +9 -5
- data/spec/dummy/db/.gitignore +1 -0
- data/spec/dummy/db/migrate/20121119085620_devise_create_users.rb +1 -1
- data/spec/dummy/db/migrate/20140418160449_create_admin_users.rb +1 -1
- data/spec/dummy/db/migrate/20191022100000_create_students.rb +14 -0
- data/spec/dummy/db/schema.rb +37 -31
- data/spec/models/user_spec.rb +3 -30
- data/spec/orm/active_record.rb +5 -2
- data/spec/spec_helper.rb +3 -3
- data/spec/support/factories.rb +13 -9
- metadata +61 -19
- data/lib/devise_masquerade/model.rb +0 -42
- data/spec/controllers/masquerades_controller_spec.rb +0 -42
- data/spec/dummy/app/controllers/masquerades_controller.rb +0 -5
@@ -1,7 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module DeviseMasquerade
|
2
|
-
|
3
|
-
|
4
|
-
|
4
|
+
module Rails
|
5
|
+
|
6
|
+
class Engine < ::Rails::Engine
|
7
|
+
initializer "devise.url_helpers" do
|
8
|
+
Devise.include_helpers(DeviseMasquerade::Controllers)
|
9
|
+
end
|
10
|
+
|
11
|
+
ActiveSupport.on_load(:action_controller) do
|
12
|
+
include DeviseMasquerade::Controllers::Helpers
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
5
16
|
end
|
6
17
|
end
|
7
|
-
|
@@ -1,17 +1,20 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
4
|
-
protected
|
1
|
+
module DeviseMasquerade
|
2
|
+
module Routes
|
5
3
|
|
6
4
|
def devise_masquerade(mapping, controllers)
|
7
5
|
resources :masquerade,
|
8
|
-
:
|
9
|
-
:
|
10
|
-
:
|
6
|
+
path: mapping.path_names[:masquerade],
|
7
|
+
controller: controllers[:masquerades],
|
8
|
+
only: [] do
|
11
9
|
|
12
|
-
|
10
|
+
collection do
|
11
|
+
get :show
|
12
|
+
get :back
|
13
|
+
end
|
13
14
|
end
|
14
15
|
end
|
16
|
+
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
20
|
+
ActionDispatch::Routing::Mapper.send :include, DeviseMasquerade::Routes
|
data/lib/devise_masquerade.rb
CHANGED
@@ -1,22 +1,16 @@
|
|
1
1
|
require 'devise'
|
2
|
-
|
3
|
-
require 'action_controller'
|
4
|
-
require 'action_controller/base'
|
5
2
|
require 'devise_masquerade/version'
|
6
3
|
require 'devise_masquerade/routes'
|
7
4
|
require 'devise_masquerade/controllers/helpers'
|
8
5
|
require 'devise_masquerade/controllers/url_helpers'
|
9
6
|
require 'devise_masquerade/rails'
|
10
7
|
|
11
|
-
module DeviseMasquerade
|
12
|
-
end
|
13
|
-
|
14
8
|
module Devise
|
15
9
|
mattr_accessor :masquerade_param
|
16
10
|
@@masquerade_param = 'masquerade'
|
17
11
|
|
18
12
|
mattr_accessor :masquerade_expires_in
|
19
|
-
@@masquerade_expires_in =
|
13
|
+
@@masquerade_expires_in = 1.minute
|
20
14
|
|
21
15
|
mattr_accessor :masquerade_key_size
|
22
16
|
@@masquerade_key_size = 16
|
@@ -30,17 +24,37 @@ module Devise
|
|
30
24
|
# Example: Devise.masqueraded_resource_class = User
|
31
25
|
mattr_accessor :masqueraded_resource_class
|
32
26
|
|
27
|
+
# Example: Devise.masqueraded_resource_class_name = 'User'
|
28
|
+
mattr_accessor :masqueraded_resource_class_name
|
29
|
+
|
33
30
|
# Example: Devise.masqueraded_resource_name = :user
|
34
31
|
mattr_accessor :masqueraded_resource_name
|
35
32
|
|
36
33
|
# Example: Devise.masquerading_resource_class = AdminUser
|
37
34
|
mattr_accessor :masquerading_resource_class
|
38
35
|
|
36
|
+
# Example: Devise.masquerading_resource_class_name = 'AdminUser'
|
37
|
+
mattr_accessor :masquerading_resource_class_name
|
38
|
+
|
39
39
|
# Example: Devise.masquerading_resource_name = :admin_user
|
40
40
|
mattr_accessor :masquerading_resource_name
|
41
41
|
|
42
|
+
# Example: Devise.masquerade_storage_method = :session
|
43
|
+
# - session
|
44
|
+
# - cache
|
45
|
+
mattr_accessor :masquerade_storage_method
|
46
|
+
@@masquerade_storage_method = :session
|
47
|
+
|
48
|
+
def self.masquerade_storage_method_session?
|
49
|
+
Devise.masquerade_storage_method == :session
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.masquerade_storage_method_cache?
|
53
|
+
Devise.masquerade_storage_method == :cache
|
54
|
+
end
|
55
|
+
|
42
56
|
@@helpers << DeviseMasquerade::Controllers::Helpers
|
43
57
|
end
|
44
58
|
|
45
|
-
Devise.add_module :masqueradable, :
|
46
|
-
:
|
59
|
+
Devise.add_module :masqueradable, controller: :masquerades,
|
60
|
+
model: 'devise_masquerade/models', route: :masquerade
|
@@ -5,14 +5,13 @@ describe Admin::DashboardController, type: :controller do
|
|
5
5
|
before { admin_logged_in }
|
6
6
|
|
7
7
|
context 'and admin masquerade by user' do
|
8
|
-
let!(:
|
8
|
+
let!(:mask) { create(:admin_user) }
|
9
9
|
|
10
10
|
before do
|
11
|
-
|
12
|
-
get :index, :masquerade => user.masquerade_key
|
11
|
+
get :index, params: { masquerade: mask.masquerade_key, masqueraded_resource_class: 'Admin::User' }
|
13
12
|
end
|
14
13
|
|
15
|
-
it { expect(current_admin_user.reload).to eq(
|
14
|
+
it { expect(current_admin_user.reload).to eq(mask) }
|
16
15
|
end
|
17
16
|
end
|
18
17
|
end
|
@@ -5,15 +5,13 @@ describe DashboardController, type: :controller do
|
|
5
5
|
before { logged_in }
|
6
6
|
|
7
7
|
context 'and admin masquerade by user' do
|
8
|
-
let!(:
|
8
|
+
let!(:mask) { create(:user) }
|
9
9
|
|
10
10
|
before do
|
11
|
-
|
12
|
-
|
13
|
-
get :index, :masquerade => user.masquerade_key
|
11
|
+
get :index, params: { masquerade: mask.masquerade_key }
|
14
12
|
end
|
15
13
|
|
16
|
-
it { expect(current_user.reload).to eq(
|
14
|
+
it { expect(current_user.reload).to eq(mask) }
|
17
15
|
end
|
18
16
|
end
|
19
17
|
end
|
@@ -1,9 +1,31 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Devise::MasqueradesController, type: :controller do
|
4
|
+
before { Devise.masquerade_storage_method = :cache }
|
5
|
+
after { Devise.masquerade_storage_method = :session }
|
6
|
+
|
4
7
|
context 'with configured devise app' do
|
5
8
|
before { @request.env['devise.mapping'] = Devise.mappings[:user] }
|
6
9
|
|
10
|
+
context 'when logged in' do
|
11
|
+
before { logged_in }
|
12
|
+
|
13
|
+
context 'with masqueradable_class param' do
|
14
|
+
let(:mask) { create(:student) }
|
15
|
+
|
16
|
+
before do
|
17
|
+
get :show, params: { id: mask.id, masqueraded_resource_class: mask.class.name, masquerade: mask.masquerade_key }
|
18
|
+
end
|
19
|
+
|
20
|
+
it { expect(cache_read(mask)).to be }
|
21
|
+
|
22
|
+
it 'should have warden keys defined' do
|
23
|
+
expect(session["warden.user.student.key"].first.first).to eq(mask.id)
|
24
|
+
end
|
25
|
+
|
26
|
+
it { should redirect_to('/') }
|
27
|
+
end
|
28
|
+
end
|
7
29
|
context 'when logged in' do
|
8
30
|
before { logged_in }
|
9
31
|
|
@@ -11,69 +33,77 @@ describe Devise::MasqueradesController, type: :controller do
|
|
11
33
|
let(:mask) { create(:user) }
|
12
34
|
|
13
35
|
before do
|
14
|
-
|
15
|
-
get :show, :id => mask.to_param
|
36
|
+
get :show, params: { id: mask.id, masquerade: mask.masquerade_key }
|
16
37
|
end
|
17
38
|
|
18
|
-
it { expect(
|
39
|
+
it { expect(cache_read(mask)).to be }
|
19
40
|
it { expect(session["warden.user.user.key"].first.first).to eq(mask.id) }
|
20
|
-
it { should redirect_to(
|
41
|
+
it { should redirect_to('/') }
|
21
42
|
|
22
43
|
context 'and back' do
|
23
44
|
before { get :back }
|
24
45
|
|
25
46
|
it { should redirect_to(masquerade_page) }
|
26
47
|
it { expect(current_user.reload).to eq(@user) }
|
27
|
-
it { expect(
|
48
|
+
it { expect(cache_read(mask)).not_to be }
|
28
49
|
end
|
50
|
+
end
|
29
51
|
|
30
|
-
|
31
|
-
|
32
|
-
|
52
|
+
# Configure masquerade_routes_back setting
|
53
|
+
describe 'config#masquerade_routes_back' do
|
54
|
+
let(:mask) { create(:user) }
|
33
55
|
|
34
|
-
|
35
|
-
before { expect(SecureRandom).to receive(:urlsafe_base64) { "secure_key" } }
|
56
|
+
before { Devise.setup { |c| c.masquerade_routes_back = true } }
|
36
57
|
|
37
|
-
|
38
|
-
before do
|
39
|
-
@request.env['HTTP_REFERER'] = 'previous_location'
|
40
|
-
get :show, id: mask.to_param
|
41
|
-
end # before
|
58
|
+
after { Devise.masquerade_routes_back = false }
|
42
59
|
|
43
|
-
|
44
|
-
|
60
|
+
context 'show' do
|
61
|
+
context 'with http referrer' do
|
62
|
+
before do
|
63
|
+
@request.env['HTTP_REFERER'] = 'previous_location'
|
64
|
+
get :show, params: { id: mask.id, masquerade: mask.masquerade_key }
|
65
|
+
end # before
|
45
66
|
|
46
|
-
|
47
|
-
|
48
|
-
allow_any_instance_of(described_class).to receive(:after_masquerade_path_for).and_return("/dashboard?color=red")
|
49
|
-
end
|
67
|
+
it { should redirect_to('previous_location') }
|
68
|
+
end # context
|
50
69
|
|
51
|
-
|
70
|
+
context 'no http referrer' do
|
71
|
+
before do
|
72
|
+
allow_any_instance_of(described_class).to(
|
73
|
+
receive(:after_masquerade_path_for).and_return("/dashboard?color=red"))
|
74
|
+
end
|
75
|
+
|
76
|
+
before { get :show, params: { id: mask.id, masquerade: mask.masquerade_key } }
|
52
77
|
|
53
|
-
|
54
|
-
end # context
|
78
|
+
it { should redirect_to("/dashboard?color=red") }
|
55
79
|
end # context
|
80
|
+
end # context
|
56
81
|
|
57
|
-
|
58
|
-
|
82
|
+
context 'and back' do
|
83
|
+
before do
|
84
|
+
get :show, params: { id: mask.id, masquerade: mask.masquerade_key }
|
59
85
|
|
60
|
-
|
61
|
-
end
|
86
|
+
get :back
|
87
|
+
end
|
62
88
|
|
63
|
-
|
64
|
-
|
65
|
-
@request.env['HTTP_REFERER'] = 'previous_location'
|
66
|
-
get :back
|
67
|
-
end
|
89
|
+
it { should redirect_to(masquerade_page) }
|
90
|
+
end # context
|
68
91
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
92
|
+
context 'and back fallback if http_referer not present' do
|
93
|
+
before do
|
94
|
+
get :show, params: { id: mask.id, masquerade: mask.masquerade_key }
|
95
|
+
|
96
|
+
@request.env['HTTP_REFERER'] = 'previous_location'
|
97
|
+
get :back
|
98
|
+
end
|
99
|
+
|
100
|
+
it { should redirect_to('previous_location') }
|
101
|
+
end # context
|
102
|
+
end # describe
|
73
103
|
end
|
74
104
|
|
75
105
|
context 'when not logged in' do
|
76
|
-
before { get :show, :id
|
106
|
+
before { get :show, params: { id: 'any_id' } }
|
77
107
|
|
78
108
|
it { should redirect_to(new_user_session_path) }
|
79
109
|
end
|
@@ -83,4 +113,16 @@ describe Devise::MasqueradesController, type: :controller do
|
|
83
113
|
def masquerade_page
|
84
114
|
"/"
|
85
115
|
end
|
116
|
+
|
117
|
+
def guid
|
118
|
+
session[:devise_masquerade_masquerading_resource_guid]
|
119
|
+
end
|
120
|
+
|
121
|
+
def cache_read(user)
|
122
|
+
Rails.cache.read(cache_key(user))
|
123
|
+
end
|
124
|
+
|
125
|
+
def cache_key(user)
|
126
|
+
"devise_masquerade_#{mask.class.name.downcase}_#{mask.id}_#{guid}"
|
127
|
+
end
|
86
128
|
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MasqueradesTestsController, type: :controller do
|
4
|
+
before { Devise.masquerade_storage_method = :cache }
|
5
|
+
after { Devise.masquerade_storage_method = :session }
|
6
|
+
|
7
|
+
before { @request.env['devise.mapping'] = Devise.mappings[:user] }
|
8
|
+
|
9
|
+
context 'no access for masquerade' do
|
10
|
+
before do
|
11
|
+
session.clear
|
12
|
+
allow_any_instance_of(MasqueradesTestsController).to receive(:masquerade_authorized?) { false }
|
13
|
+
end
|
14
|
+
|
15
|
+
before { logged_in }
|
16
|
+
|
17
|
+
let(:mask) { create(:user) }
|
18
|
+
|
19
|
+
before { get :show, params: { id: mask.id, masquerade: mask.masquerade_key } }
|
20
|
+
|
21
|
+
it { expect(response.status).to eq(403) }
|
22
|
+
it { expect(cache_read(mask)).not_to be }
|
23
|
+
it { expect(session['warden.user.user.key'].first.first).not_to eq(mask.id) }
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'access for masquerade' do
|
27
|
+
before do
|
28
|
+
session.clear
|
29
|
+
allow_any_instance_of(MasqueradesTestsController).to receive(:masquerade_authorized?) { true }
|
30
|
+
end
|
31
|
+
|
32
|
+
before { logged_in }
|
33
|
+
|
34
|
+
let(:mask) { create(:user) }
|
35
|
+
|
36
|
+
before do
|
37
|
+
get :show, params: { id: mask.id, masquerade: mask.masquerade_key }
|
38
|
+
end
|
39
|
+
|
40
|
+
it { expect(response.status).to eq(302) }
|
41
|
+
it { expect(cache_read(mask)).to be }
|
42
|
+
it { expect(session['warden.user.user.key'].first.first).to eq(mask.id) }
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
def guid
|
47
|
+
session[:devise_masquerade_masquerading_resource_guid]
|
48
|
+
end
|
49
|
+
|
50
|
+
def cache_read(user)
|
51
|
+
Rails.cache.read(cache_key(user))
|
52
|
+
end
|
53
|
+
|
54
|
+
def cache_key(user)
|
55
|
+
"devise_masquerade_#{mask.class.name.downcase}_#{mask.id}_#{guid}"
|
56
|
+
end
|
57
|
+
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
class Admin::DashboardController < ApplicationController
|
2
|
-
|
3
|
-
before_filter :masquerade_admin_user!
|
2
|
+
before_action :authenticate_admin_user!
|
4
3
|
|
5
4
|
def index
|
6
5
|
@users = Admin::User.where("admin_users.id != ?", current_admin_user.id).all
|
@@ -1,9 +1,12 @@
|
|
1
1
|
class DashboardController < ApplicationController
|
2
|
-
|
3
|
-
before_filter :masquerade_user!
|
2
|
+
before_action :authenticate_user!
|
4
3
|
|
5
4
|
def index
|
6
5
|
@users = User.where("users.id != ?", current_user.id).all
|
7
6
|
end
|
7
|
+
|
8
|
+
def extra_params
|
9
|
+
@users = User.where("users.id != ?", current_user.id).all
|
10
|
+
end
|
8
11
|
end
|
9
12
|
|
@@ -1,13 +1,6 @@
|
|
1
1
|
class Admin::User < ActiveRecord::Base
|
2
|
-
# Include default devise modules. Others available are:
|
3
|
-
# :token_authenticatable, :confirmable,
|
4
|
-
# :lockable, :timeoutable and :omniauthable
|
5
2
|
devise :database_authenticatable, :registerable,
|
6
3
|
:recoverable, :rememberable, :trackable, :validatable,
|
7
4
|
:masqueradable
|
8
|
-
|
9
|
-
# Setup accessible (or protected) attributes for your model
|
10
|
-
attr_accessible :email, :password, :password_confirmation, :remember_me
|
11
|
-
# attr_accessible :title, :body
|
12
5
|
end
|
13
6
|
|
@@ -1,12 +1,3 @@
|
|
1
1
|
class User < ActiveRecord::Base
|
2
|
-
|
3
|
-
# :token_authenticatable, :confirmable,
|
4
|
-
# :lockable, :timeoutable and :omniauthable
|
5
|
-
devise :database_authenticatable, :registerable,
|
6
|
-
:recoverable, :rememberable, :trackable, :validatable,
|
7
|
-
:masqueradable
|
8
|
-
|
9
|
-
# Setup accessible (or protected) attributes for your model
|
10
|
-
attr_accessible :email, :password, :password_confirmation, :remember_me
|
11
|
-
# attr_accessible :title, :body
|
2
|
+
devise :database_authenticatable, :validatable, :masqueradable
|
12
3
|
end
|
@@ -8,10 +8,18 @@
|
|
8
8
|
</head>
|
9
9
|
<body>
|
10
10
|
<% if signed_in? %>
|
11
|
-
|
11
|
+
<% if user_signed_in? %>
|
12
|
+
<h1 class='current_user'><%= current_user.email %></h1>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<% if student_signed_in? %>
|
16
|
+
<h1 class='current_student'><%= current_student.email %></h1>
|
17
|
+
<% end %>
|
12
18
|
|
13
19
|
<% if user_masquerade? %>
|
14
|
-
|
20
|
+
<h1 class='owner_user'><%= user_masquerade_owner.email %></h1>
|
21
|
+
|
22
|
+
<%= link_to "Back masquerade", back_masquerade_path(User.new) %>
|
15
23
|
<% end %>
|
16
24
|
<% end %>
|
17
25
|
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render @students %>
|
data/spec/dummy/config/routes.rb
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
Dummy::Application.routes.draw do
|
2
|
-
devise_for :users, controllers: { masquerades:
|
3
|
-
devise_for :admin_users, :
|
2
|
+
devise_for :users, controllers: { masquerades: 'users/masquerades' }
|
3
|
+
devise_for :admin_users, class_name: Admin::User.name
|
4
|
+
devise_for :students, class_name: Student.name
|
4
5
|
|
5
|
-
root :
|
6
|
+
root to: 'dashboard#index'
|
6
7
|
|
7
|
-
|
8
|
+
get '/extra_params', to: 'dashboard#extra_params'
|
9
|
+
|
10
|
+
resources :masquerades_tests
|
11
|
+
resources :students, only: :index
|
8
12
|
|
9
13
|
namespace :admin do
|
10
|
-
root :
|
14
|
+
root to: 'dashboard#index'
|
11
15
|
end
|
12
16
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
test.sqlite3*
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateStudents < ActiveRecord::Migration[5.2]
|
2
|
+
def change
|
3
|
+
create_table(:students) do |t|
|
4
|
+
t.string :email, null: false, default: ''
|
5
|
+
t.string :encrypted_password, null: false, default: ''
|
6
|
+
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
|
10
|
+
add_index :students, :email, unique: true
|
11
|
+
add_index :students, :reset_password_token, unique: true
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|