lesli_shield 1.0.1 → 1.0.3
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 +4 -4
- data/app/assets/stylesheets/lesli_shield/confirmations.css +31 -0
- data/app/assets/stylesheets/lesli_shield/devise/oauth.css +32 -0
- data/app/assets/stylesheets/lesli_shield/passwords.css +18953 -1
- data/app/assets/stylesheets/lesli_shield/registrations.css +19040 -1
- data/app/assets/stylesheets/lesli_shield/sessions.css +19040 -1
- data/app/assets/stylesheets/lesli_shield/users.css +30 -0
- data/app/controllers/lesli_shield/role/actions_controller.rb +1 -1
- data/app/controllers/lesli_shield/roles_controller.rb +1 -1
- data/app/controllers/users/confirmations_controller.rb +1 -1
- data/app/controllers/users/registrations_controller.rb +2 -2
- data/app/interfaces/lesli_shield/authorization_interface.rb +2 -2
- data/app/models/lesli_shield/account.rb +2 -1
- data/app/models/lesli_shield/dashboard.rb +33 -24
- data/app/operators/lesli_shield/user_registration_operator.rb +123 -0
- data/app/services/lesli_shield/tokens.rb +1 -1
- data/app/views/devise/passwords/new.html.erb +1 -1
- data/app/views/devise/sessions/new.html.erb +2 -0
- data/app/views/lesli_shield/roles/_form-privileges.html.erb +2 -2
- data/app/views/lesli_shield/users/_information-card.html.erb +3 -3
- data/app/views/lesli_shield/users/show.html.erb +1 -1
- data/lib/lesli_shield/engine.rb +3 -3
- data/lib/lesli_shield/version.rb +2 -2
- data/lib/scss/_devise-simple.scss +1 -1
- data/lib/scss/_devise.scss +11 -19
- data/lib/scss/registrations.scss +32 -0
- data/lib/scss/sessions.scss +31 -0
- data/lib/tasks/lesli_shield_tasks.rake +3 -4
- metadata +18 -16
@@ -1 +1,31 @@
|
|
1
|
+
@charset "UTF-8";
|
2
|
+
/*
|
3
|
+
Lesli
|
1
4
|
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
*/
|
@@ -40,7 +40,7 @@ module LesliShield
|
|
40
40
|
|
41
41
|
def show
|
42
42
|
@role = @role.show
|
43
|
-
@role_actions = Lesli::Role::ActionService.new(current_user, query).index(
|
43
|
+
@role_actions = Lesli::Role::ActionService.new(current_user, query).index(@role.id)
|
44
44
|
end
|
45
45
|
|
46
46
|
# @return [HTML] HTML view for creating a new role
|
@@ -26,7 +26,7 @@ class Users::ConfirmationsController < Devise::ConfirmationsController
|
|
26
26
|
activity = user.activities.create({ title: "user_confirmation", description: "Confirmation process started" })
|
27
27
|
|
28
28
|
|
29
|
-
registration_operator =
|
29
|
+
registration_operator = LesliShield::UserRegistrationOperator.new(user)
|
30
30
|
|
31
31
|
# confirm the user
|
32
32
|
registration_operator.confirm
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lesli
|
6
6
|
|
7
|
-
Copyright (c)
|
7
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
8
8
|
|
9
9
|
This program is free software: you can redistribute it and/or modify
|
10
10
|
it under the terms of the GNU General Public License as published by
|
@@ -21,7 +21,7 @@ along with this program. If not, see http://www.gnu.org/licenses/.
|
|
21
21
|
|
22
22
|
Lesli · Ruby on Rails SaaS Development Framework.
|
23
23
|
|
24
|
-
Made with ♥ by
|
24
|
+
Made with ♥ by LesliTech
|
25
25
|
Building a better future, one line of code at a time.
|
26
26
|
|
27
27
|
@contact hello@lesli.tech
|
@@ -28,12 +28,12 @@ module LesliShield
|
|
28
28
|
# privilege for object not found
|
29
29
|
if granted.blank?
|
30
30
|
current_user.activities.create({ title: "privilege_not_found", description: request.path })
|
31
|
-
return respond_with_unauthorized({ controller: params[:controller],
|
31
|
+
return respond_with_unauthorized({ controller: params[:controller], action: params[:action] })
|
32
32
|
end
|
33
33
|
|
34
34
|
unless granted
|
35
35
|
current_user.activities.create({ title: "privilege_not_granted", description: request.path })
|
36
|
-
return respond_with_unauthorized({ controller: params[:controller],
|
36
|
+
return respond_with_unauthorized({ controller: params[:controller], action: params[:action] })
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -33,11 +33,12 @@ Building a better future, one line of code at a time.
|
|
33
33
|
module LesliShield
|
34
34
|
class Account < ApplicationRecord
|
35
35
|
belongs_to :account, class_name: "Lesli::Account"
|
36
|
+
has_many :dashboards
|
36
37
|
|
37
38
|
after_create :initialize_account
|
38
39
|
|
39
40
|
def initialize_account
|
40
|
-
|
41
|
+
Dashboard.initialize_account(self)
|
41
42
|
end
|
42
43
|
end
|
43
44
|
end
|
@@ -1,31 +1,40 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by LesliTech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
1
33
|
module LesliShield
|
2
34
|
class Dashboard < Lesli::Shared::Dashboard
|
3
35
|
self.table_name = "lesli_shield_dashboards"
|
4
36
|
belongs_to :account
|
5
37
|
|
6
|
-
|
7
|
-
accepts_nested_attributes_for :components, allow_destroy: true
|
8
|
-
|
9
|
-
def self.initialize_account(account)
|
10
|
-
self.create!(
|
11
|
-
account: account,
|
12
|
-
name: "Audit Default Dashboard",
|
13
|
-
default: true,
|
14
|
-
main: false,
|
15
|
-
components_attributes: [{
|
16
|
-
name: "Total users",
|
17
|
-
component_id: "audit-users",
|
18
|
-
layout: 3,
|
19
|
-
query_configuration: {},
|
20
|
-
custom_configuration: {}
|
21
|
-
}, {
|
22
|
-
name: "Roles",
|
23
|
-
component_id: "audit-roles",
|
24
|
-
layout: 3,
|
25
|
-
query_configuration: {},
|
26
|
-
custom_configuration: {}
|
27
|
-
}]
|
28
|
-
)
|
29
|
-
end
|
38
|
+
COMPONENTS = %i[]
|
30
39
|
end
|
31
40
|
end
|
@@ -0,0 +1,123 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails Development Platform.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
|
32
|
+
=end
|
33
|
+
|
34
|
+
module LesliShield
|
35
|
+
class UserRegistrationOperator < Lesli::ApplicationLesliService
|
36
|
+
|
37
|
+
def initialize(current_user)
|
38
|
+
@resource = current_user
|
39
|
+
@current_user = current_user
|
40
|
+
end
|
41
|
+
|
42
|
+
def confirm
|
43
|
+
|
44
|
+
if current_user.blank?
|
45
|
+
failures.push(I18n.t("core.shared.messages_warning_user_not_found"))
|
46
|
+
return self
|
47
|
+
end
|
48
|
+
|
49
|
+
# confirm the user
|
50
|
+
current_user.confirm
|
51
|
+
|
52
|
+
# force token deletion so we are sure nobody will be able to use the token again
|
53
|
+
resource.update(confirmation_token: nil)
|
54
|
+
|
55
|
+
# send a welcome email to user as is confirmed
|
56
|
+
Lesli::DeviseMailer.with(user: resource).welcome.deliver_later
|
57
|
+
|
58
|
+
# initialize user dependencies
|
59
|
+
current_user.after_confirmation
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
def create_account
|
64
|
+
|
65
|
+
if resource.blank?
|
66
|
+
failures.push(I18n.t("core.shared.messages_warning_user_not_found"))
|
67
|
+
return self
|
68
|
+
end
|
69
|
+
|
70
|
+
if resource.account
|
71
|
+
failures.push(I18n.t("core.users.messages_info_user_already_belongs_to_account"))
|
72
|
+
return self
|
73
|
+
end
|
74
|
+
|
75
|
+
# check if instance is for multi-account
|
76
|
+
allow_multiaccount = Lesli.config.security.dig(:allow_multiaccount)
|
77
|
+
|
78
|
+
# create new account for the new user only if multi-account is allowed
|
79
|
+
if allow_multiaccount === true
|
80
|
+
account = Lesli::Account.create!({
|
81
|
+
user: resource, # set user as owner of his just created account
|
82
|
+
name: "Lesli", # temporary company name
|
83
|
+
email: resource.email,
|
84
|
+
status: :active # account is active due user already confirmed his email
|
85
|
+
})
|
86
|
+
end
|
87
|
+
|
88
|
+
# if multi-account is not allowed user belongs to the first account in instance
|
89
|
+
if allow_multiaccount === false
|
90
|
+
account = Lesli::Account.first
|
91
|
+
end
|
92
|
+
|
93
|
+
# add user to his own account
|
94
|
+
resource.account = account
|
95
|
+
|
96
|
+
# add owner role to user only if multi-account is allowed
|
97
|
+
if allow_multiaccount == true
|
98
|
+
resource.roles.create({ role: account.roles.find_by(name: "owner") })
|
99
|
+
end
|
100
|
+
|
101
|
+
# add profile role to user only if multi-account is allowed
|
102
|
+
if allow_multiaccount == false
|
103
|
+
# Assigning default role if defined in account settings
|
104
|
+
# Otherwise, the default role is "limited"
|
105
|
+
#default_role_id = account.settings.find_by(:name => "default_role_id")&.value
|
106
|
+
default_role_id = nil
|
107
|
+
|
108
|
+
if default_role_id.present?
|
109
|
+
resource.roles.create({ role: account.roles.find_by(:id => default_role_id)})
|
110
|
+
else
|
111
|
+
resource.roles.create({ role: account.roles.find_by(name: "limited") })
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
# update user :)
|
116
|
+
resource.save
|
117
|
+
|
118
|
+
# initialize user dependencies
|
119
|
+
resource.after_account_assignation
|
120
|
+
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
@@ -17,7 +17,7 @@
|
|
17
17
|
label: "Enter your email address you use in Lesli. We'll send instructions for setting a new password to your email.")
|
18
18
|
%>
|
19
19
|
|
20
|
-
<%= form.field_control_button("Send me reset password instructions", icon:"
|
20
|
+
<%= form.field_control_button("Send me reset password instructions", icon:"mail") %>
|
21
21
|
|
22
22
|
<% if Lesli.config.security.dig(:allow_registration) %>
|
23
23
|
<p class="account has-text-centered">
|
@@ -65,7 +65,7 @@ columns = [{
|
|
65
65
|
<% row.with_cell do %>
|
66
66
|
<% if action %>
|
67
67
|
<%= button_to role_action_path(action),
|
68
|
-
method: :delete,
|
68
|
+
method: (action[:active] == 1 ? :delete : :patch),
|
69
69
|
class: "mini-toggle #{action[:active] == 1 ? 'active' : ''}",
|
70
70
|
form: { "x-data" => "toggleForm", "x-on:submit.prevent" => "submit($el)" } do %>
|
71
71
|
<span class="mini-toggle-slider"></span>
|
@@ -87,7 +87,7 @@ columns = [{
|
|
87
87
|
'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]').content,
|
88
88
|
'Accept': 'text/vnd.turbo-stream.html' // or 'application/json'
|
89
89
|
},
|
90
|
-
body: new URLSearchParams(new FormData(form))
|
90
|
+
//body: new URLSearchParams(new FormData(form))
|
91
91
|
}).then(response => {
|
92
92
|
if (!response.ok) throw new Error("Request failed");
|
93
93
|
return response.text();
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<a class="level-item"
|
17
17
|
href="'mailto:'+storeUser.user.email">
|
18
18
|
<span class="icon is-small mr-2">
|
19
|
-
<span class="material-
|
19
|
+
<span class="material-symbols">
|
20
20
|
email
|
21
21
|
</span>
|
22
22
|
</span>
|
@@ -25,7 +25,7 @@
|
|
25
25
|
<a class="level-item mx-2"
|
26
26
|
href="'tel:'+storeUser.user.telephone">
|
27
27
|
<span class="icon is-small mr-2">
|
28
|
-
<span class="material-
|
28
|
+
<span class="material-symbols">
|
29
29
|
phone
|
30
30
|
</span>
|
31
31
|
</span>
|
@@ -35,7 +35,7 @@
|
|
35
35
|
<!-- Show the max role -->
|
36
36
|
<p class="level-item" v-if="storeUser.role_names">
|
37
37
|
<span class="icon is-small mr-2">
|
38
|
-
<span class="material-
|
38
|
+
<span class="material-symbols">
|
39
39
|
security
|
40
40
|
</span>
|
41
41
|
</span>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<%= render LesliView::Components::Tabs.new() do |tabs| %>
|
6
6
|
|
7
|
-
<% tabs.with_tab(title:"information", icon:"
|
7
|
+
<% tabs.with_tab(title:"information", icon:"info") do %>
|
8
8
|
<%= render "information-form" %>
|
9
9
|
<% end %>
|
10
10
|
<% tabs.with_tab(title:"Privileges", icon:"security") do %>
|
data/lib/lesli_shield/engine.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Lesli
|
4
4
|
|
5
|
-
Copyright (c)
|
5
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
6
6
|
|
7
7
|
This program is free software: you can redistribute it and/or modify
|
8
8
|
it under the terms of the GNU General Public License as published by
|
@@ -19,11 +19,11 @@ along with this program. If not, see http://www.gnu.org/licenses/.
|
|
19
19
|
|
20
20
|
Lesli · Ruby on Rails SaaS Development Framework.
|
21
21
|
|
22
|
-
Made with ♥ by
|
22
|
+
Made with ♥ by LesliTech
|
23
23
|
Building a better future, one line of code at a time.
|
24
24
|
|
25
25
|
@contact hello@lesli.tech
|
26
|
-
@website https://www.lesli.
|
26
|
+
@website https://www.lesli.tech
|
27
27
|
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
28
|
|
29
29
|
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
data/lib/lesli_shield/version.rb
CHANGED
data/lib/scss/_devise.scss
CHANGED
@@ -34,31 +34,24 @@ Building a better future, one line of code at a time.
|
|
34
34
|
|
35
35
|
// ·
|
36
36
|
@use "lesli-css" as lesli;
|
37
|
-
@use "LesliAssets/lib/
|
37
|
+
@use "LesliAssets/lib/lesli_assets_styles/templates/public";
|
38
38
|
|
39
39
|
|
40
|
-
// ·
|
41
|
-
|
42
|
-
width: 100%;
|
43
|
-
border-radius: 4px;
|
44
|
-
border: 1px solid silver;
|
45
|
-
}
|
40
|
+
// · Configuration & variables
|
41
|
+
@use "LesliAssets/lib/lesli_assets_styles/settings/variables";
|
46
42
|
|
47
43
|
|
48
|
-
// ·
|
49
|
-
|
50
|
-
|
51
|
-
rgba(49, 106, 255, 0.4),
|
52
|
-
rgba(49, 106, 255, 0.4)),
|
53
|
-
url("lesli/brand/login-background.jpg");
|
54
|
-
background-position: center;
|
55
|
-
background-size: cover;
|
44
|
+
// · headings and links
|
45
|
+
h1, h2, h3, h4, h5, h6, a {
|
46
|
+
font-family: "Domine", variables.$family-primary;
|
56
47
|
}
|
57
48
|
|
58
49
|
|
59
|
-
//
|
60
|
-
.
|
61
|
-
|
50
|
+
// ·
|
51
|
+
.shield-form-demo {
|
52
|
+
width: 100%;
|
53
|
+
border-radius: 4px;
|
54
|
+
border: 1px solid silver;
|
62
55
|
}
|
63
56
|
|
64
57
|
|
@@ -144,7 +137,6 @@ Building a better future, one line of code at a time.
|
|
144
137
|
.column.login-form {
|
145
138
|
width: 100%;
|
146
139
|
max-width: 100%;
|
147
|
-
@include lesli-login-background;
|
148
140
|
|
149
141
|
.hero {
|
150
142
|
padding: 2rem 0;
|
data/lib/scss/registrations.scss
CHANGED
@@ -31,5 +31,37 @@ Building a better future, one line of code at a time.
|
|
31
31
|
*/
|
32
32
|
|
33
33
|
|
34
|
+
|
35
|
+
// ·
|
36
|
+
@use "lesli-css" as lesli;
|
37
|
+
|
38
|
+
|
34
39
|
// ·
|
35
40
|
@use "devise";
|
41
|
+
|
42
|
+
|
43
|
+
// ·
|
44
|
+
@mixin lesli-register-background() {
|
45
|
+
background: linear-gradient(0deg,
|
46
|
+
rgba(49, 106, 255, 0.4),
|
47
|
+
rgba(49, 106, 255, 0.4)),
|
48
|
+
url("/lesli/brand/register-background.jpg");
|
49
|
+
background-position: center;
|
50
|
+
background-size: cover;
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
// ·
|
55
|
+
.column.background {
|
56
|
+
@include lesli-register-background;
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
// ·
|
61
|
+
@include lesli.lesli-breakpoint-until-tablet() {
|
62
|
+
|
63
|
+
// login column must be full width on mobile
|
64
|
+
.column.login-form {
|
65
|
+
@include lesli-register-background;
|
66
|
+
}
|
67
|
+
}
|
data/lib/scss/sessions.scss
CHANGED
@@ -31,5 +31,36 @@ Building a better future, one line of code at a time.
|
|
31
31
|
*/
|
32
32
|
|
33
33
|
|
34
|
+
// ·
|
35
|
+
@use "lesli-css" as lesli;
|
36
|
+
|
37
|
+
|
34
38
|
// ·
|
35
39
|
@use "devise";
|
40
|
+
|
41
|
+
|
42
|
+
// ·
|
43
|
+
@mixin lesli-login-background() {
|
44
|
+
background: linear-gradient(0deg,
|
45
|
+
rgba(49, 106, 255, 0.4),
|
46
|
+
rgba(49, 106, 255, 0.4)),
|
47
|
+
url("/lesli/brand/login-background.jpg");
|
48
|
+
background-position: center;
|
49
|
+
background-size: cover;
|
50
|
+
}
|
51
|
+
|
52
|
+
|
53
|
+
// ·
|
54
|
+
.column.background {
|
55
|
+
@include lesli-login-background;
|
56
|
+
}
|
57
|
+
|
58
|
+
|
59
|
+
// ·
|
60
|
+
@include lesli.lesli-breakpoint-until-tablet() {
|
61
|
+
|
62
|
+
// login column must be full width on mobile
|
63
|
+
.column.login-form {
|
64
|
+
@include lesli-login-background;
|
65
|
+
}
|
66
|
+
}
|
@@ -34,16 +34,15 @@ namespace :lesli_shield do
|
|
34
34
|
|
35
35
|
desc "Syncing privileges for all the available roles"
|
36
36
|
task :privileges => :environment do |task, args|
|
37
|
-
|
37
|
+
lesli_shield_privileges()
|
38
38
|
end
|
39
39
|
|
40
40
|
# Drop, build, migrate & seed database (development only)
|
41
|
-
def
|
41
|
+
def lesli_shield_privileges
|
42
42
|
|
43
43
|
Lesli::Role.all.each do |role|
|
44
|
+
L2.info("LesliShield: Syncing privileges for #{role.name} role.")
|
44
45
|
Lesli::RoleOperator.new(role).synchronize
|
45
46
|
end
|
46
|
-
|
47
|
-
L2.msg("LesliShield: Syncing privileges for all the available roles")
|
48
47
|
end
|
49
48
|
end
|