lesli_shield 1.1.1 → 1.1.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 +1 -18952
- data/app/assets/stylesheets/lesli_shield/devise/oauth.css +0 -32
- data/app/assets/stylesheets/lesli_shield/passwords.css +1 -18905
- data/app/assets/stylesheets/lesli_shield/registrations.css +1 -18993
- data/app/assets/stylesheets/lesli_shield/sessions.css +1 -18993
- data/app/assets/stylesheets/lesli_shield/users.css +0 -30
- data/app/controllers/lesli_shield/roles_controller.rb +2 -8
- data/app/models/concerns/lesli_shield/user_security.rb +1 -1
- data/app/services/lesli_shield/role_action_service.rb +9 -12
- data/app/services/lesli_shield/role_privilege_service.rb +1 -1
- data/app/views/devise/shared/_application-devise-simple.erb +5 -5
- data/app/views/devise/shared/_application-devise.html.erb +3 -3
- data/app/views/lesli_shield/role/actions/_form.html.erb +0 -4
- data/lib/lesli_shield/version.rb +2 -2
- data/lib/tasks/lesli_shield_tasks.rake +1 -2
- metadata +1 -1
|
@@ -1,31 +1 @@
|
|
|
1
|
-
@charset "UTF-8";
|
|
2
|
-
/*
|
|
3
|
-
Lesli
|
|
4
1
|
|
|
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
|
-
*/
|
|
@@ -32,16 +32,10 @@ Building a better future, one line of code at a time.
|
|
|
32
32
|
|
|
33
33
|
module LesliShield
|
|
34
34
|
class RolesController < ApplicationController
|
|
35
|
-
before_action :set_role, only: %i[ show update destroy ]
|
|
35
|
+
before_action :set_role, only: %i[ show update destroy deploy ]
|
|
36
36
|
|
|
37
37
|
def deploy
|
|
38
|
-
|
|
39
|
-
pp params[:id]
|
|
40
|
-
pp params[:id]
|
|
41
|
-
pp params[:id]
|
|
42
|
-
|
|
43
|
-
RolePrivilegeService.new.synchronize(Lesli::Role.first)
|
|
44
|
-
|
|
38
|
+
RolePrivilegeService.new.synchronize(@role.result)
|
|
45
39
|
respond_with_lesli(
|
|
46
40
|
:turbo => stream_notification_success("success")
|
|
47
41
|
)
|
|
@@ -21,20 +21,21 @@ module LesliShield
|
|
|
21
21
|
|
|
22
22
|
Role::Action.with_deleted.joins(action: :parent)
|
|
23
23
|
.where(:role_id => role_id)
|
|
24
|
+
.order('parents_lesli_resources.route')
|
|
24
25
|
.select(
|
|
25
26
|
:id,
|
|
26
27
|
:role_id,
|
|
27
28
|
:deleted_at,
|
|
28
29
|
"parents_lesli_resources.id as controller_id",
|
|
29
30
|
"parents_lesli_resources.label as controller_name",
|
|
31
|
+
"parents_lesli_resources.route as controller_route",
|
|
30
32
|
"lesli_resources.action as action_name",
|
|
31
33
|
"lesli_resources.id as action_id",
|
|
32
34
|
"case when lesli_shield_role_actions.deleted_at is null then TRUE else FALSE end active"
|
|
33
35
|
).each do |action|
|
|
34
36
|
|
|
35
|
-
unless role_actions.has_key?(action[:
|
|
36
|
-
role_actions[action[:
|
|
37
|
-
list:nil,
|
|
37
|
+
unless role_actions.has_key?(action[:controller_route])
|
|
38
|
+
role_actions[action[:controller_route]] = {
|
|
38
39
|
index: nil,
|
|
39
40
|
show:nil,
|
|
40
41
|
create:nil,
|
|
@@ -43,28 +44,24 @@ module LesliShield
|
|
|
43
44
|
}
|
|
44
45
|
end
|
|
45
46
|
|
|
46
|
-
if action[:action_name] == "list"
|
|
47
|
-
role_actions[action[:controller_name]][:list] = clean(action)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
47
|
if action[:action_name] == "index"
|
|
51
|
-
role_actions[action[:
|
|
48
|
+
role_actions[action[:controller_route]][:index] = clean(action)
|
|
52
49
|
end
|
|
53
50
|
|
|
54
51
|
if action[:action_name] == "show"
|
|
55
|
-
role_actions[action[:
|
|
52
|
+
role_actions[action[:controller_route]][:show] = clean(action)
|
|
56
53
|
end
|
|
57
54
|
|
|
58
55
|
if action[:action_name] == "create"
|
|
59
|
-
role_actions[action[:
|
|
56
|
+
role_actions[action[:controller_route]][:create] = clean(action)
|
|
60
57
|
end
|
|
61
58
|
|
|
62
59
|
if action[:action_name] == "update"
|
|
63
|
-
role_actions[action[:
|
|
60
|
+
role_actions[action[:controller_route]][:update] = clean(action)
|
|
64
61
|
end
|
|
65
62
|
|
|
66
63
|
if action[:action_name] == "destroy"
|
|
67
|
-
role_actions[action[:
|
|
64
|
+
role_actions[action[:controller_route]][:destroy] = clean(action)
|
|
68
65
|
end
|
|
69
66
|
end
|
|
70
67
|
|
|
@@ -62,7 +62,7 @@ module LesliShield
|
|
|
62
62
|
lesli_shield_role_actions.role_id as role_id,
|
|
63
63
|
resource_controllers.route as controller,
|
|
64
64
|
resource_actions.action as action,
|
|
65
|
-
lesli_shield_role_actions.deleted_at
|
|
65
|
+
case when lesli_shield_role_actions.deleted_at is null then TRUE else FALSE end active
|
|
66
66
|
)).with_deleted
|
|
67
67
|
|
|
68
68
|
# get privileges only for the given role, this is needed to sync only modified roles
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
Lesli
|
|
5
5
|
|
|
6
|
-
Copyright (c)
|
|
6
|
+
Copyright (c) 2026, Lesli Technologies, S. A.
|
|
7
7
|
|
|
8
8
|
This program is free software: you can redistribute it and/or modify
|
|
9
9
|
it under the terms of the GNU General Public License as published by
|
|
@@ -18,9 +18,9 @@ GNU General Public License for more details.
|
|
|
18
18
|
You should have received a copy of the GNU General Public License
|
|
19
19
|
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
20
20
|
|
|
21
|
-
Lesli · Ruby on Rails SaaS
|
|
21
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
|
22
22
|
|
|
23
|
-
Made with ♥ by
|
|
23
|
+
Made with ♥ by LesliTech
|
|
24
24
|
Building a better future, one line of code at a time.
|
|
25
25
|
|
|
26
26
|
@contact hello@lesli.tech
|
|
@@ -40,8 +40,8 @@ Building a better future, one line of code at a time.
|
|
|
40
40
|
<%# Logo container %>
|
|
41
41
|
<div class="logo mb-4">
|
|
42
42
|
<%= image_tag(
|
|
43
|
-
"
|
|
44
|
-
:class => "#{lesli_instance_code}-logo",
|
|
43
|
+
"lesli_assets/brand/app-auth.svg",
|
|
44
|
+
:class => "#{lesli_instance_code}-logo",
|
|
45
45
|
:alt => "Main logo")
|
|
46
46
|
%>
|
|
47
47
|
<h1 class="title is-size-4 has-text-primary">
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Lesli
|
|
4
4
|
|
|
5
|
-
Copyright (c)
|
|
5
|
+
Copyright (c) 2026, 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
|
|
@@ -54,8 +54,8 @@ Building a better future, one line of code at a time.
|
|
|
54
54
|
<%# Logo container %>
|
|
55
55
|
<div class="logo has-text-centered mb-6">
|
|
56
56
|
<%= image_tag(
|
|
57
|
-
"lesli_assets/brand/app-auth.svg",
|
|
58
|
-
:class => "#{lesli_instance_code}-logo mb-2",
|
|
57
|
+
"lesli_assets/brand/app-auth.svg",
|
|
58
|
+
:class => "#{lesli_instance_code}-logo mb-2",
|
|
59
59
|
:alt => "Main logo")
|
|
60
60
|
%>
|
|
61
61
|
<h1 class="is-title is-size-3 has-text-primary">
|
data/lib/lesli_shield/version.rb
CHANGED
|
@@ -39,10 +39,9 @@ namespace :lesli_shield do
|
|
|
39
39
|
|
|
40
40
|
# Drop, build, migrate & seed database (development only)
|
|
41
41
|
def lesli_shield_privileges
|
|
42
|
-
|
|
43
42
|
Lesli::Role.all.each do |role|
|
|
44
|
-
Termline.info("LesliShield: Syncing privileges for #{role.name} role.")
|
|
45
43
|
LesliShield::RolePrivilegeService.new(nil).synchronize(role)
|
|
44
|
+
Termline.success("LesliShield: Syncing privileges for #{role.name} role.")
|
|
46
45
|
end
|
|
47
46
|
end
|
|
48
47
|
end
|