lesli_shield 1.0.2 → 1.0.4
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 +18763 -0
- data/app/assets/stylesheets/lesli_shield/devise/oauth.css +32 -0
- data/app/assets/stylesheets/lesli_shield/passwords.css +18717 -1
- data/app/assets/stylesheets/lesli_shield/registrations.css +18804 -1
- data/app/assets/stylesheets/lesli_shield/sessions.css +18804 -1
- data/app/assets/stylesheets/lesli_shield/users.css +30 -0
- data/app/controllers/lesli_shield/dashboards_controller.rb +1 -8
- data/app/controllers/lesli_shield/invites_controller.rb +80 -0
- data/app/controllers/lesli_shield/role/actions_controller.rb +32 -20
- data/app/controllers/lesli_shield/roles_controller.rb +16 -8
- data/app/controllers/lesli_shield/sessions_controller.rb +5 -8
- data/app/controllers/lesli_shield/user/roles_controller.rb +62 -0
- data/app/controllers/lesli_shield/users_controller.rb +57 -20
- data/app/controllers/users/confirmations_controller.rb +42 -8
- data/app/controllers/users/passwords_controller.rb +52 -37
- data/app/controllers/users/registrations_controller.rb +2 -8
- data/app/controllers/users/sessions_controller.rb +57 -50
- data/app/helpers/lesli_shield/invites_helper.rb +4 -0
- data/app/helpers/lesli_shield/user/roles_helper.rb +4 -0
- data/app/interfaces/lesli_shield/authorization_interface.rb +8 -2
- data/app/mailers/lesli_shield/devise_mailer.rb +98 -0
- data/app/mailers/lesli_shield/invitation.html.erb +23 -0
- data/app/models/concerns/lesli_shield/user_security.rb +222 -0
- data/app/models/lesli_shield/account.rb +1 -1
- data/app/models/lesli_shield/dashboard.rb +1 -4
- data/app/models/lesli_shield/invite.rb +24 -0
- data/{lib/vue/confirmations.js → app/models/lesli_shield/role/action.rb} +17 -10
- data/{db/migrate/v1/0801003010_create_lesli_shield_dashboards.rb → app/models/lesli_shield/role/privilege.rb} +5 -4
- data/app/models/lesli_shield/user/role.rb +8 -0
- data/app/models/lesli_shield/user/session.rb +80 -0
- data/app/services/lesli_shield/invite_service.rb +43 -0
- data/app/services/lesli_shield/role_action_service.rb +118 -0
- data/app/services/lesli_shield/role_privilege_service.rb +112 -0
- data/app/{operators/lesli_shield/user_registration_operator.rb → services/lesli_shield/user_registration_service.rb} +26 -29
- data/app/services/lesli_shield/user_session_service.rb +78 -0
- data/app/services/lesli_shield/user_validator_service.rb +221 -0
- data/app/views/devise/confirmations/show.html.erb +4 -6
- data/app/views/devise/passwords/edit.html.erb +1 -2
- data/app/views/devise/passwords/new.html.erb +1 -1
- data/app/views/devise/registrations/new.html.erb +5 -4
- data/app/views/devise/sessions/new.html.erb +3 -2
- data/app/views/devise/shared/_application-devise-simple.erb +59 -0
- data/app/views/devise/shared/_application-devise.html.erb +76 -0
- data/app/views/lesli_shield/dashboards/_component-calendar.html.erb +1 -0
- data/app/views/lesli_shield/dashboards/_component-chart-bar.html.erb +6 -0
- data/app/views/lesli_shield/dashboards/_component-chart-line.html.erb +8 -0
- data/app/views/lesli_shield/dashboards/_component-count.html.erb +1 -0
- data/app/views/lesli_shield/dashboards/_component-date.html.erb +1 -0
- data/app/views/lesli_shield/dashboards/_component-weather.html.erb +1 -0
- data/app/views/lesli_shield/invites/_form.html.erb +10 -0
- data/app/views/lesli_shield/invites/_invite.html.erb +2 -0
- data/app/views/lesli_shield/invites/edit.html.erb +12 -0
- data/app/views/lesli_shield/invites/index.html.erb +66 -0
- data/{db/migrate/v1/0801001710_create_lesli_shield_settings.rb → app/views/lesli_shield/invites/new.html.erb} +9 -10
- data/{lib/vue/apps/dashboards/components/engine-version.vue → app/views/lesli_shield/invites/show.html.erb} +26 -43
- data/app/views/lesli_shield/partials/_navigation.html.erb +2 -4
- data/app/views/lesli_shield/{roles/_form-privileges.html.erb → role/actions/_form.html.erb} +5 -30
- data/app/views/lesli_shield/role/actions/index.html.erb +14 -0
- data/app/views/lesli_shield/roles/index.html.erb +2 -6
- data/app/views/lesli_shield/roles/new.html.erb +0 -11
- data/app/views/lesli_shield/roles/show.html.erb +5 -8
- data/app/views/lesli_shield/user/roles/_form.html.erb +17 -0
- data/app/views/lesli_shield/user/roles/_role.html.erb +2 -0
- data/app/views/lesli_shield/user/roles/edit.html.erb +12 -0
- data/app/views/lesli_shield/user/roles/index.html.erb +16 -0
- data/app/views/lesli_shield/user/roles/new.html.erb +11 -0
- data/app/views/lesli_shield/user/roles/show.html.erb +10 -0
- data/app/views/lesli_shield/users/{_viewer-activities.html.erb → _activities-viewer.html.erb} +2 -4
- data/app/views/lesli_shield/users/_information-card.html.erb +3 -3
- data/app/views/lesli_shield/users/_management-privileges.html.erb +74 -0
- data/app/views/lesli_shield/users/_management-security.html.erb +5 -0
- data/app/views/lesli_shield/users/index.html.erb +3 -7
- data/app/views/lesli_shield/users/new.html.erb +5 -11
- data/app/views/lesli_shield/users/show.html.erb +7 -5
- data/config/initializers/devise.rb +305 -304
- data/config/locales/translations.en.yml +4 -1
- data/config/locales/translations.es.yml +4 -1
- data/config/locales/translations.it.yml +4 -1
- data/config/routes.rb +7 -8
- data/db/migrate/v1/0801100210_create_lesli_shield_role_actions.rb +48 -0
- data/db/migrate/v1/0801100410_create_lesli_shield_role_privileges.rb +45 -0
- data/db/migrate/v1/0801110110_create_lesli_shield_user_roles.rb +43 -0
- data/db/migrate/v1/0801111210_create_lesli_shield_user_sessions.rb +56 -0
- data/db/migrate/v1/0801120110_create_lesli_shield_invites.rb +49 -0
- data/lib/lesli_shield/engine.rb +3 -3
- data/lib/lesli_shield/router.rb +21 -0
- data/lib/lesli_shield/version.rb +2 -2
- data/lib/lesli_shield.rb +1 -1
- data/lib/scss/_devise.scss +10 -0
- data/lib/scss/confirmations.scss +24 -24
- data/lib/tasks/lesli_shield_tasks.rake +1 -1
- data/readme.md +59 -20
- metadata +69 -44
- data/app/controllers/lesli_shield/dashboard/components_controller.rb +0 -60
- data/app/models/lesli_shield/dashboard/component.rb +0 -18
- data/app/views/lesli_shield/dashboards/edit.html.erb +0 -1
- data/app/views/lesli_shield/dashboards/index.html.erb +0 -9
- data/app/views/lesli_shield/dashboards/new.html.erb +0 -1
- data/app/views/lesli_shield/dashboards/show.html.erb +0 -1
- data/app/views/lesli_shield/roles/_session.html.erb +0 -2
- data/app/views/lesli_shield/roles/edit.html.erb +0 -12
- data/app/views/lesli_shield/roles/update.turbo_stream.erb +0 -3
- data/app/views/lesli_shield/users/update.turbo_stream.erb +0 -3
- data/lib/lesli_shield/routing.rb +0 -23
- data/lib/vue/application.js +0 -83
- data/lib/vue/apps/sessions/index.vue +0 -50
- data/lib/vue/passwords.js +0 -137
- data/lib/vue/registrations.js +0 -144
- data/lib/vue/sessions.js +0 -148
- data/lib/vue/stores/sessions.js +0 -43
- data/lib/vue/stores/translations.json +0 -162
- /data/app/views/lesli_shield/roles/{_form-information.html.erb → _form.html.erb} +0 -0
- /data/db/migrate/v1/{0801120310_create_lesli_shield_user_shortcuts.rb → 0801111010_create_lesli_shield_user_shortcuts.rb} +0 -0
- /data/db/migrate/v1/{0801120410_create_lesli_shield_user_tokens.rb → 0801111110_create_lesli_shield_user_tokens.rb} +0 -0
data/config/routes.rb
CHANGED
|
@@ -44,10 +44,10 @@ Building a better future, one line of code at a time.
|
|
|
44
44
|
# ·
|
|
45
45
|
LesliShield::Engine.routes.draw do
|
|
46
46
|
|
|
47
|
-
Lesli::
|
|
47
|
+
Lesli::Router.mount_lesli_engine_routes(self)
|
|
48
48
|
|
|
49
49
|
resources :sessions, only: [:index, :show]
|
|
50
|
-
resources :users, only: [:index, :show, :update] do
|
|
50
|
+
resources :users, only: [:index, :show, :update, :new, :create] do
|
|
51
51
|
|
|
52
52
|
# extensions to the user methods
|
|
53
53
|
scope module: :user do
|
|
@@ -56,7 +56,7 @@ LesliShield::Engine.routes.draw do
|
|
|
56
56
|
resources :sessions, only: [:index, :destroy]
|
|
57
57
|
|
|
58
58
|
# assign and remove roles to users
|
|
59
|
-
resources :roles, only: [:index, :create, :destroy]
|
|
59
|
+
resources :roles, only: [:index, :create, :update, :destroy]
|
|
60
60
|
|
|
61
61
|
# shortcuts
|
|
62
62
|
resources :shortcuts, only: [:index, :create, :update, :destroy]
|
|
@@ -68,15 +68,14 @@ LesliShield::Engine.routes.draw do
|
|
|
68
68
|
|
|
69
69
|
# Work with roles and privileges
|
|
70
70
|
resources :roles, only: [:index, :show, :edit, :update, :new, :create, :destroy] do
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
member do
|
|
72
|
+
post :deploy
|
|
73
73
|
end
|
|
74
74
|
scope module: :role do
|
|
75
75
|
resources :privileges
|
|
76
|
-
resources :actions
|
|
76
|
+
resources :actions, only: [:index, :update, :destroy]
|
|
77
77
|
end
|
|
78
78
|
end
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
resource :settings, only: [:show]
|
|
80
|
+
resources :invites, only: [:index, :show, :new, :create, :update]
|
|
82
81
|
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
Lesli
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026, 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
|
+
|
|
33
|
+
class CreateLesliShieldRoleActions < ActiveRecord::Migration[7.0]
|
|
34
|
+
def change
|
|
35
|
+
create_table :lesli_shield_role_actions do |t|
|
|
36
|
+
t.datetime :deleted_at, index: true
|
|
37
|
+
t.timestamps
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
add_reference(:lesli_shield_role_actions, :role, foreign_key: { to_table: :lesli_roles })
|
|
41
|
+
add_reference(:lesli_shield_role_actions, :action,
|
|
42
|
+
foreign_key: { to_table: :lesli_resources },
|
|
43
|
+
index: { name: "role_actions_resources" })
|
|
44
|
+
|
|
45
|
+
add_index(:lesli_shield_role_actions, [:role_id, :action_id], unique: true,
|
|
46
|
+
name: "index_role_actions_on_role_and_action")
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
Lesli
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026, 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
|
+
|
|
33
|
+
class CreateLesliShieldRolePrivileges < ActiveRecord::Migration[7.0]
|
|
34
|
+
def change
|
|
35
|
+
create_table :lesli_shield_role_privileges do |t|
|
|
36
|
+
t.string :controller
|
|
37
|
+
t.string :action
|
|
38
|
+
t.boolean :active
|
|
39
|
+
t.datetime :deleted_at, index: true
|
|
40
|
+
t.timestamps
|
|
41
|
+
end
|
|
42
|
+
add_reference(:lesli_shield_role_privileges, :role, foreign_key: { to_table: :lesli_roles })
|
|
43
|
+
add_index(:lesli_shield_role_privileges, %i[controller action role_id], unique: true, name: "shield_role_privileges_index")
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
|
|
33
|
+
class CreateLesliShieldUserRoles < ActiveRecord::Migration[6.0]
|
|
34
|
+
def change
|
|
35
|
+
create_table :lesli_shield_user_roles do |t|
|
|
36
|
+
t.datetime :deleted_at, index: true
|
|
37
|
+
t.timestamps
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
add_reference(:lesli_shield_user_roles, :user, foreign_key: { to_table: :lesli_users })
|
|
41
|
+
add_reference(:lesli_shield_user_roles, :role, foreign_key: { to_table: :lesli_roles })
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
|
|
33
|
+
class CreateLesliShieldUserSessions < ActiveRecord::Migration[6.0]
|
|
34
|
+
def change
|
|
35
|
+
create_table :lesli_shield_user_sessions do |t|
|
|
36
|
+
|
|
37
|
+
t.string :remote # IPv4 and IPv6 hosts and networks
|
|
38
|
+
|
|
39
|
+
t.string :agent_platform
|
|
40
|
+
t.string :agent_os
|
|
41
|
+
t.string :agent_browser
|
|
42
|
+
t.string :agent_version
|
|
43
|
+
|
|
44
|
+
t.string :session_token # authentication token
|
|
45
|
+
t.string :session_source # session created for/with
|
|
46
|
+
|
|
47
|
+
t.integer :usage_count # total number of interactions
|
|
48
|
+
t.datetime :last_used_at # last datetime token was used
|
|
49
|
+
t.datetime :expiration_at, index: true # auto-expire session at
|
|
50
|
+
t.datetime :deleted_at, index: true
|
|
51
|
+
|
|
52
|
+
t.timestamps
|
|
53
|
+
end
|
|
54
|
+
add_reference(:lesli_shield_user_sessions, :user, foreign_key: { to_table: :lesli_users })
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
Lesli
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026, 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
|
+
|
|
33
|
+
class CreateLesliShieldInvites < ActiveRecord::Migration[8.0]
|
|
34
|
+
def change
|
|
35
|
+
create_table :lesli_shield_invites do |t|
|
|
36
|
+
t.string :email, null: false
|
|
37
|
+
t.string :full_name
|
|
38
|
+
t.string :telephone
|
|
39
|
+
t.text :notes
|
|
40
|
+
t.integer :status, index: true
|
|
41
|
+
t.datetime :sent_at, index: true
|
|
42
|
+
t.datetime :expired_at, index: true
|
|
43
|
+
t.datetime :deleted_at, index: true
|
|
44
|
+
t.timestamps
|
|
45
|
+
end
|
|
46
|
+
add_reference(:lesli_shield_invites, :user, foreign_key: { to_table: :lesli_users })
|
|
47
|
+
add_reference(:lesli_shield_invites, :account, foreign_key: { to_table: :lesli_shield_accounts })
|
|
48
|
+
end
|
|
49
|
+
end
|
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
|
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module LesliShield
|
|
2
|
+
module Router
|
|
3
|
+
def self.mount_login_at(router, path="")
|
|
4
|
+
router.devise_for :users, class_name: "Lesli::User", module: :devise,
|
|
5
|
+
:path => path,
|
|
6
|
+
:path_names => {
|
|
7
|
+
:sign_in => "login",
|
|
8
|
+
:sign_out => "logout",
|
|
9
|
+
:sign_up => "register",
|
|
10
|
+
:password => "password",
|
|
11
|
+
:confirmation => "confirmation"
|
|
12
|
+
},
|
|
13
|
+
:controllers => {
|
|
14
|
+
:registrations => "users/registrations",
|
|
15
|
+
:confirmations => "users/confirmations",
|
|
16
|
+
:passwords => "users/passwords",
|
|
17
|
+
:sessions => "users/sessions"
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
data/lib/lesli_shield/version.rb
CHANGED
data/lib/lesli_shield.rb
CHANGED
data/lib/scss/_devise.scss
CHANGED
|
@@ -37,6 +37,16 @@ Building a better future, one line of code at a time.
|
|
|
37
37
|
@use "LesliAssets/lib/lesli_assets_styles/templates/public";
|
|
38
38
|
|
|
39
39
|
|
|
40
|
+
// · Configuration & variables
|
|
41
|
+
@use "LesliAssets/lib/lesli_assets_styles/settings/variables";
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
// · headings and links
|
|
45
|
+
h1, h2, h3, h4, h5, h6, a {
|
|
46
|
+
font-family: "Domine", variables.$family-primary;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
40
50
|
// ·
|
|
41
51
|
.shield-form-demo {
|
|
42
52
|
width: 100%;
|
data/lib/scss/confirmations.scss
CHANGED
|
@@ -32,27 +32,27 @@ Building a better future, one line of code at a time.
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
// ·
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
35
|
+
@use "lesli-css" as lesli;
|
|
36
|
+
@use "devise-simple";
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
// ·
|
|
40
|
+
div.confirmation-message {
|
|
41
|
+
//box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
|
|
42
|
+
padding: 4rem 0 5rem;
|
|
43
|
+
text-align: center;
|
|
44
|
+
max-width: 800px;
|
|
45
|
+
margin: 0 auto;
|
|
46
|
+
width: 90%;
|
|
47
|
+
|
|
48
|
+
svg {
|
|
49
|
+
max-width: 90px;
|
|
50
|
+
margin-bottom: 1rem;
|
|
51
|
+
fill: lesli.lesli-color(lime, 300);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
p {
|
|
55
|
+
font-size: 2rem;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
@@ -42,7 +42,7 @@ namespace :lesli_shield do
|
|
|
42
42
|
|
|
43
43
|
Lesli::Role.all.each do |role|
|
|
44
44
|
L2.info("LesliShield: Syncing privileges for #{role.name} role.")
|
|
45
|
-
|
|
45
|
+
LesliShield::RolePrivilegeService.new(nil).synchronize(role)
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
end
|
data/readme.md
CHANGED
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
<div align="center"
|
|
1
|
+
<div align="center">
|
|
2
2
|
<img width="100" alt="LesliShield logo" src="./app/assets/images/lesli_shield/shield-logo.svg" />
|
|
3
|
-
<h3 align="center">
|
|
3
|
+
<h3 align="center">Administration area for the Lesli Framework.</h3>
|
|
4
4
|
</div>
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
<br />
|
|
8
7
|
<hr/>
|
|
9
8
|
|
|
10
|
-
<div align="center"
|
|
11
|
-
<a target="
|
|
12
|
-
<img
|
|
9
|
+
<div align="center">
|
|
10
|
+
<a target="_blank" href="https://github.com/LesliTech/LesliShield/actions">
|
|
11
|
+
<img alt="Tests passing" src="https://img.shields.io/badge/Tests-passing-green?style=for-the-badge&logo=github">
|
|
13
12
|
</a>
|
|
14
|
-
<a
|
|
15
|
-
<img
|
|
13
|
+
<a target="_blank" href="https://rubygems.org/gems/lesli_shield">
|
|
14
|
+
<img alt="Gem Version" src="https://img.shields.io/gem/v/lesli_shield?style=for-the-badge&logo=ruby">
|
|
16
15
|
</a>
|
|
17
|
-
<a href="https://codecov.io/github/LesliTech/
|
|
18
|
-
<img
|
|
16
|
+
<a target="_blank" href="https://codecov.io/github/LesliTech/LesliShield">
|
|
17
|
+
<img alt="Codecov" src="https://img.shields.io/codecov/c/github/LesliTech/LesliShield?style=for-the-badge&logo=codecov">
|
|
19
18
|
</a>
|
|
20
19
|
</div>
|
|
21
20
|
|
|
22
21
|
<hr/>
|
|
23
22
|
<br />
|
|
24
23
|
|
|
24
|
+
<div align="center">
|
|
25
|
+
<img
|
|
26
|
+
style="width:100%;max-width:800px;border-radius:6px;"
|
|
27
|
+
alt="Lesli screenshot" src="./docs/images/screenshot.png" />
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<br />
|
|
31
|
+
<hr/>
|
|
32
|
+
<br />
|
|
25
33
|
|
|
26
|
-
###
|
|
34
|
+
### Installation
|
|
27
35
|
|
|
28
36
|
```shell
|
|
29
37
|
# Add LesliShield engine gem
|
|
30
38
|
bundle add lesli_shield
|
|
31
|
-
```
|
|
32
39
|
|
|
33
|
-
```shell
|
|
34
40
|
# Setup & initialize the database
|
|
35
41
|
rake lesli:db:setup
|
|
36
42
|
```
|
|
@@ -42,26 +48,52 @@ Rails.application.routes.draw do
|
|
|
42
48
|
end
|
|
43
49
|
```
|
|
44
50
|
|
|
51
|
+
<br />
|
|
52
|
+
<hr/>
|
|
53
|
+
<br />
|
|
45
54
|
|
|
46
|
-
###
|
|
55
|
+
### Development
|
|
56
|
+
|
|
57
|
+
```shell
|
|
58
|
+
# clone the lesli repo inside your engine folder: RailsApp/engines
|
|
59
|
+
git clone https://github.com/LesliTech/LesliShield.git
|
|
60
|
+
|
|
61
|
+
# Load LesliShield as a Gem
|
|
62
|
+
gem "lesli", path: "engines/LesliShield"
|
|
63
|
+
|
|
64
|
+
# Install the necessary Gems to run LesliShield
|
|
65
|
+
bundle install
|
|
47
66
|
|
|
67
|
+
# Setup & initialize the database
|
|
68
|
+
rake lesli:db:setup
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
<br />
|
|
73
|
+
<hr/>
|
|
74
|
+
<br />
|
|
48
75
|
|
|
76
|
+
### Demo
|
|
49
77
|
|
|
50
|
-
|
|
78
|
+
* [online demo](https://demo.lesli.dev/)
|
|
79
|
+
* [docker demo](https://github.com/LesliTech/lesli-docker-demo)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Documentation
|
|
51
83
|
* [website](https://www.lesli.dev/)
|
|
52
|
-
* [documentation](https://www.lesli.dev/engines/shield
|
|
84
|
+
* [documentation](https://www.lesli.dev/engines/shield)
|
|
53
85
|
|
|
54
86
|
|
|
55
|
-
###
|
|
87
|
+
### Connect with Lesli
|
|
56
88
|
|
|
89
|
+
* [X: @LesliTech](https://x.com/LesliTech)
|
|
57
90
|
* [Email: hello@lesli.tech](hello@lesli.tech)
|
|
58
91
|
* [Website: https://www.lesli.tech](https://www.lesli.tech)
|
|
59
|
-
* [Twitter: @LesliTech](https://twitter.com/LesliTech)
|
|
60
92
|
|
|
61
93
|
|
|
62
94
|
### License
|
|
63
95
|
-------
|
|
64
|
-
Copyright (c)
|
|
96
|
+
Copyright (c) 2026, Lesli Technologies, S. A.
|
|
65
97
|
|
|
66
98
|
This program is free software: you can redistribute it and/or modify
|
|
67
99
|
it under the terms of the GNU General Public License as published by
|
|
@@ -76,10 +108,17 @@ GNU General Public License for more details.
|
|
|
76
108
|
You should have received a copy of the GNU General Public License
|
|
77
109
|
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
78
110
|
|
|
111
|
+
<br />
|
|
79
112
|
<hr />
|
|
80
113
|
<br />
|
|
114
|
+
<br />
|
|
81
115
|
|
|
82
116
|
<div align="center" class="has-text-centered">
|
|
83
117
|
<img width="200" alt="Lesli logo" src="https://cdn.lesli.tech/lesli/brand/app-logo.svg" />
|
|
84
|
-
<
|
|
118
|
+
<h3 align="center" class="mt-0">
|
|
119
|
+
The Open-Source SaaS Development Framework for Ruby on Rails.
|
|
120
|
+
</h3>
|
|
85
121
|
</div>
|
|
122
|
+
|
|
123
|
+
<br />
|
|
124
|
+
<br />
|