lesli_shield 1.1.6 → 1.1.8
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/Rakefile +3 -0
- data/app/assets/stylesheets/lesli_shield/application.css +1222 -1
- data/app/assets/stylesheets/lesli_shield/confirmations.css +917 -18
- data/app/assets/stylesheets/lesli_shield/confirmations.tailwind.css +918 -0
- data/app/assets/stylesheets/lesli_shield/invitations.css +1008 -0
- data/app/assets/stylesheets/lesli_shield/passwords.css +872 -18
- data/app/assets/stylesheets/lesli_shield/passwords.tailwind.css +873 -0
- data/app/assets/stylesheets/lesli_shield/registrations.css +904 -832
- data/app/assets/stylesheets/lesli_shield/registrations.tailwind.css +908 -0
- data/app/assets/stylesheets/lesli_shield/sessions.css +984 -32
- data/app/assets/stylesheets/lesli_shield/sessions.tailwind.css +983 -1
- data/app/controllers/lesli_shield/invites_controller.rb +100 -49
- data/app/controllers/lesli_shield/profile/passwords_controller.rb +119 -0
- data/app/controllers/lesli_shield/profiles_controller.rb +69 -0
- data/app/controllers/lesli_shield/role/actions_controller.rb +134 -38
- data/app/controllers/lesli_shield/roles_controller.rb +114 -141
- data/app/controllers/lesli_shield/sessions_controller.rb +1 -2
- data/app/controllers/lesli_shield/users_controller.rb +11 -4
- data/app/controllers/users/confirmations_controller.rb +162 -49
- data/app/controllers/users/invitations_controller.rb +101 -0
- data/app/controllers/users/passwords_controller.rb +211 -28
- data/app/controllers/users/registrations_controller.rb +108 -83
- data/app/controllers/users/sessions_controller.rb +124 -84
- data/app/interfaces/lesli_shield/authorization_interface.rb +2 -2
- data/app/jobs/lesli_shield/invitation_delivery_job.rb +123 -0
- data/app/mailers/lesli_shield/devise_mailer.rb +73 -17
- data/app/mailers/lesli_shield/invitation_mailer.rb +58 -0
- data/app/models/concerns/lesli_shield/role_management.rb +70 -0
- data/app/models/concerns/lesli_shield/user_authentication.rb +54 -0
- data/app/models/concerns/lesli_shield/user_security.rb +22 -19
- data/app/models/lesli_shield/account.rb +4 -1
- data/app/models/lesli_shield/invite.rb +183 -12
- data/app/models/lesli_shield/user/role.rb +1 -1
- data/app/models/lesli_shield/user.rb +5 -2
- data/app/services/lesli_shield/invitation_audit.rb +34 -0
- data/app/services/lesli_shield/invitation_email_policy.rb +64 -0
- data/app/services/lesli_shield/invitation_service.rb +405 -0
- data/app/services/lesli_shield/invite_service.rb +34 -5
- data/app/services/lesli_shield/profile/password_service.rb +47 -0
- data/app/services/lesli_shield/profile_service.rb +25 -0
- data/app/services/lesli_shield/role_action_service.rb +37 -92
- data/app/services/lesli_shield/role_audit.rb +42 -0
- data/app/services/lesli_shield/role_permission_service.rb +347 -0
- data/app/services/lesli_shield/role_privilege_deployment_service.rb +79 -0
- data/app/services/lesli_shield/role_privilege_service.rb +69 -105
- data/app/services/lesli_shield/role_service.rb +431 -0
- data/app/services/lesli_shield/user_registration_service.rb +41 -74
- data/app/services/lesli_shield/user_session_service.rb +1 -1
- data/app/services/lesli_shield/user_validator_service.rb +37 -39
- data/app/views/devise/confirmations/new.html.erb +58 -12
- data/app/views/devise/confirmations/show.html.erb +27 -60
- data/app/views/devise/passwords/edit.html.erb +59 -25
- data/app/views/devise/passwords/new.html.erb +61 -26
- data/app/views/devise/registrations/new.html.erb +83 -56
- data/app/views/devise/sessions/new.html.erb +58 -41
- data/app/views/devise/shared/_application-devise-simple.erb +18 -19
- data/app/views/devise/shared/_demo.html.erb +8 -6
- data/app/views/devise/shared/_error_messages.html.erb +45 -10
- data/app/views/devise/shared/_links.html.erb +10 -20
- data/app/views/lesli_shield/invites/_form.html.erb +64 -7
- data/app/views/lesli_shield/invites/_invite.html.erb +55 -2
- data/app/views/lesli_shield/invites/_invite_actions.html.erb +34 -0
- data/app/views/lesli_shield/invites/_status_badge.html.erb +13 -0
- data/app/views/lesli_shield/invites/index.html.erb +119 -62
- data/app/views/lesli_shield/invites/new.html.erb +11 -36
- data/app/views/lesli_shield/invites/show.html.erb +13 -52
- data/app/views/lesli_shield/profiles/_information-form.html.erb +11 -0
- data/app/views/lesli_shield/profiles/_password-form.html.erb +68 -0
- data/app/views/lesli_shield/profiles/show.html.erb +26 -0
- data/app/views/lesli_shield/role/actions/_custom_actions.html.erb +24 -0
- data/app/views/lesli_shield/role/actions/_deployment_status.html.erb +14 -0
- data/app/views/lesli_shield/role/actions/_matrix.html.erb +69 -0
- data/app/views/lesli_shield/role/actions/_permissions.html.erb +95 -0
- data/app/views/lesli_shield/role/actions/_toggle.html.erb +34 -0
- data/app/views/lesli_shield/role/actions/index.html.erb +14 -10
- data/app/views/lesli_shield/roles/_deployment_badge.html.erb +15 -0
- data/app/views/lesli_shield/roles/_empty_state.html.erb +20 -0
- data/app/views/lesli_shield/roles/_field_errors.html.erb +5 -0
- data/app/views/lesli_shield/roles/_filters.html.erb +66 -0
- data/app/views/lesli_shield/roles/_form.html.erb +149 -18
- data/app/views/lesli_shield/roles/_management_menu.html.erb +37 -0
- data/app/views/lesli_shield/roles/_pagination.html.erb +43 -0
- data/app/views/lesli_shield/roles/_role_list.html.erb +116 -0
- data/app/views/lesli_shield/roles/_status_badge.html.erb +11 -0
- data/app/views/lesli_shield/roles/_type_badge.html.erb +9 -0
- data/app/views/lesli_shield/roles/index.html.erb +15 -38
- data/app/views/lesli_shield/roles/new.html.erb +11 -0
- data/app/views/lesli_shield/roles/show.html.erb +79 -7
- data/app/views/lesli_shield/users/_information-form.html.erb +15 -1
- data/app/views/users/invitations/show.html.erb +142 -0
- data/app/views/users/invitations/unavailable.html.erb +19 -0
- data/config/initializers/devise.rb +52 -328
- data/config/locales/devise.en.yml +8 -0
- data/config/locales/devise.es.yml +8 -0
- data/config/locales/translations.en.yml +314 -16
- data/config/locales/translations.es.yml +314 -16
- data/config/routes.rb +14 -3
- data/db/migrate/v1/0801120110_create_lesli_shield_invites.rb +40 -6
- data/lib/lesli_shield/engine.rb +42 -4
- data/lib/lesli_shield/router.rb +62 -18
- data/lib/lesli_shield/version.rb +2 -2
- data/lib/tasks/lesli_shield_tasks.rake +1 -1
- data/readme.md +17 -3
- metadata +63 -8
- data/app/assets/config/lesli_shield_manifest.js +0 -48
- data/app/assets/stylesheets/lesli_shield/application.tailwind.css +0 -2
- data/app/mailers/lesli_shield/invitation.html.erb +0 -23
- data/app/views/lesli_shield/invites/edit.html.erb +0 -12
- data/app/views/lesli_shield/role/actions/_form.html.erb +0 -75
|
@@ -1,19 +1,317 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
2
|
+
es:
|
|
3
3
|
lesli_shield:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
button_log_in: Iniciar sesión
|
|
8
|
-
view_still_not_registered: "¿Aún no tienes cuenta?"
|
|
9
|
-
button_create_account: Crear cuenta
|
|
10
|
-
devise/registrations:
|
|
11
|
-
view_title: Crea una cuenta y descubre Lesli
|
|
12
|
-
view_password_requirements: 'La contraseña debe incluir:'
|
|
13
|
-
view_password_requirements_uppercase: Una letra mayuscula
|
|
14
|
-
button_create_account: Crear cuenta
|
|
15
|
-
view_already_have_an_account: "¿Ya tienes cuenta?"
|
|
16
|
-
button_login: Iniciar sesión
|
|
4
|
+
authentication:
|
|
5
|
+
logo_alt: "Logotipo de la aplicación"
|
|
6
|
+
tagline: "Una mejor manera de gestionar tu trabajo."
|
|
17
7
|
dashboards:
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
view_password_requirements_number: "Un número"
|
|
9
|
+
view_password_requirements_symbol: "Un caracter especial"
|
|
10
|
+
devise_confirmations:
|
|
11
|
+
button_send_instructions: "Reenviar instrucciones de confirmación"
|
|
12
|
+
button_sending: "Enviando instrucciones…"
|
|
13
|
+
field_email: "Correo electrónico"
|
|
14
|
+
mailer_confirmation_subject: "Confirma tu correo electrónico"
|
|
15
|
+
mailer_welcome_subject: "Te damos la bienvenida a Lesli"
|
|
16
|
+
message_confirmation_failed: "No pudimos terminar de confirmar tu cuenta. Intenta utilizar nuevamente el enlace de confirmación."
|
|
17
|
+
message_too_many_attempts: "Demasiadas solicitudes de confirmación. Inténtalo de nuevo más tarde."
|
|
18
|
+
view_description: "Ingresa tu correo electrónico y, si la confirmación sigue pendiente, te enviaremos un nuevo enlace."
|
|
19
|
+
view_success_description: "Tu correo electrónico fue confirmado correctamente. Ya puedes iniciar sesión."
|
|
20
|
+
view_success_title: "Cuenta confirmada"
|
|
21
|
+
view_title: "Reenviar instrucciones de confirmación"
|
|
22
|
+
devise_passwords:
|
|
23
|
+
button_send_instructions: "Enviar enlace de recuperación"
|
|
24
|
+
button_sending: "Enviando…"
|
|
25
|
+
button_update_password: "Cambiar contraseña"
|
|
26
|
+
button_updating: "Actualizando…"
|
|
27
|
+
field_email: "Correo electrónico"
|
|
28
|
+
field_password: "Nueva contraseña"
|
|
29
|
+
field_password_confirmation: "Confirmar nueva contraseña"
|
|
30
|
+
field_password_hint_one: "Usa al menos un carácter."
|
|
31
|
+
field_password_hint_other: "Usa al menos %{count} caracteres."
|
|
32
|
+
mailer_subject: "Instrucciones para restablecer tu contraseña"
|
|
33
|
+
message_too_many_attempts: "Demasiados intentos de recuperación de contraseña. Inténtalo de nuevo más tarde."
|
|
34
|
+
view_request_description: "Ingresa el correo electrónico asociado con tu cuenta. Si la cuenta existe, te enviaremos un enlace de recuperación."
|
|
35
|
+
view_request_title: "¿Olvidaste tu contraseña?"
|
|
36
|
+
view_update_description: "Elige una nueva contraseña para tu cuenta e ingrésala dos veces para confirmarla."
|
|
37
|
+
view_update_title: "Crea una nueva contraseña"
|
|
38
|
+
devise_registrations:
|
|
39
|
+
button_create_account: "Crear cuenta"
|
|
40
|
+
button_creating_account: "Creando cuenta…"
|
|
41
|
+
button_login: "Iniciar sesión"
|
|
42
|
+
label_email: "Correo electrónico"
|
|
43
|
+
label_password: "Contraseña"
|
|
44
|
+
label_password_confirmation: "Confirmar contraseña"
|
|
45
|
+
message_registration_not_allowed: "La creación de cuentas no está disponible."
|
|
46
|
+
message_too_many_attempts: "Demasiados intentos de creación de cuenta. Inténtalo de nuevo más tarde."
|
|
47
|
+
view_already_have_an_account: "¿Ya tienes cuenta?"
|
|
48
|
+
view_description: "Ingresa tu correo electrónico y elige una contraseña para crear tu cuenta."
|
|
49
|
+
view_legal_notice: "Al crear una cuenta, aceptas los Términos y reconoces la Declaración global de privacidad."
|
|
50
|
+
view_password_length: "Tu contraseña debe contener entre %{minimum} y %{maximum} caracteres."
|
|
51
|
+
view_title: "Crea una cuenta y descubre Lesli"
|
|
52
|
+
devise_sessions:
|
|
53
|
+
button_create_account: "Crear cuenta"
|
|
54
|
+
button_log_in: "Iniciar sesión"
|
|
55
|
+
demo_email: "Correo electrónico"
|
|
56
|
+
demo_password: "Contraseña"
|
|
57
|
+
demo_title: "Cuenta de demostración"
|
|
58
|
+
label_email: "Correo electrónico"
|
|
59
|
+
label_password: "Contraseña"
|
|
60
|
+
message_not_valid_credentials: "Credenciales no validas"
|
|
61
|
+
message_too_many_attempts: "Demasiados intentos de inicio de sesión. Inténtalo de nuevo más tarde."
|
|
62
|
+
view_still_not_registered: "¿Aún no tienes cuenta?"
|
|
63
|
+
view_title: ":lesli_shield.devise_sessions.view_title:"
|
|
64
|
+
devise_shared:
|
|
65
|
+
button_login: "Iniciar sesión"
|
|
66
|
+
button_magic_link: "Enlace mágico"
|
|
67
|
+
button_one_time_password: "Contraseña de un solo uso"
|
|
68
|
+
button_reset_password: "Restablecer contraseña"
|
|
69
|
+
invites:
|
|
70
|
+
acceptance_action: "Crear cuenta"
|
|
71
|
+
acceptance_cancelled_description: "Esta invitación fue cancelada y ya no puede aceptarse."
|
|
72
|
+
acceptance_cancelled_title: "Invitación cancelada"
|
|
73
|
+
acceptance_description: "Completa tu perfil para unirte a %{account}."
|
|
74
|
+
acceptance_email: "Correo electrónico"
|
|
75
|
+
acceptance_expired_description: "Esta invitación expiró. Solicita a un administrador que la reenvíe."
|
|
76
|
+
acceptance_expired_title: "Invitación expirada"
|
|
77
|
+
acceptance_first_name: "Nombres"
|
|
78
|
+
acceptance_invalid_description: "Este enlace es inválido o alcanzó su vencimiento criptográfico. Solicita una nueva invitación a un administrador."
|
|
79
|
+
acceptance_invalid_title: "Enlace de invitación inválido"
|
|
80
|
+
acceptance_last_name: "Apellidos"
|
|
81
|
+
acceptance_optional: "opcional"
|
|
82
|
+
acceptance_organization: "Organización"
|
|
83
|
+
acceptance_password: "Contraseña"
|
|
84
|
+
acceptance_password_confirmation: "Confirmar contraseña"
|
|
85
|
+
acceptance_password_hint: "Tu contraseña debe contener entre %{minimum} y %{maximum} caracteres."
|
|
86
|
+
acceptance_password_length: "Usa entre %{minimum} y %{maximum} caracteres."
|
|
87
|
+
acceptance_password_requirements: "Requisitos de contraseña"
|
|
88
|
+
acceptance_role: "Rol"
|
|
89
|
+
acceptance_submitting: "Creando cuenta…"
|
|
90
|
+
acceptance_success: "Tu cuenta para %{email} fue creada correctamente. Ya puedes iniciar sesión."
|
|
91
|
+
acceptance_telephone: "Teléfono"
|
|
92
|
+
acceptance_title: "Acepta tu invitación"
|
|
93
|
+
acceptance_unavailable_description: "Esta invitación ya no puede aceptarse. Es posible que la organización o el rol asignado ya no estén disponibles."
|
|
94
|
+
acceptance_unavailable_title: "Invitación no disponible"
|
|
95
|
+
acceptance_used_description: "Esta invitación ya fue aceptada. Puedes iniciar sesión con la cuenta creada."
|
|
96
|
+
acceptance_used_title: "Invitación ya utilizada"
|
|
97
|
+
action_cancel: "Cancelar"
|
|
98
|
+
action_create: "Crear invitación"
|
|
99
|
+
action_resend: "Reenviar"
|
|
100
|
+
action_view: "Ver"
|
|
101
|
+
button_create_and_send: "Crear y enviar invitación"
|
|
102
|
+
button_creating_and_sending: "Creando y enviando invitación…"
|
|
103
|
+
cancelled_successfully: "Invitación cancelada."
|
|
104
|
+
column_actions: "Acciones"
|
|
105
|
+
column_expires_at: "Expira"
|
|
106
|
+
column_recipient: "Destinatario"
|
|
107
|
+
column_role: "Rol"
|
|
108
|
+
column_sent_at: "Enviada"
|
|
109
|
+
column_status: "Estado"
|
|
110
|
+
confirm_cancel: "¿Cancelar esta invitación? Su historial de auditoría se conservará."
|
|
111
|
+
confirm_resend: "¿Enviar un nuevo correo de invitación?"
|
|
112
|
+
created_successfully: "Invitación creada y puesta en cola para su envío."
|
|
113
|
+
detail_accepted_at: "Aceptada el"
|
|
114
|
+
detail_cancelled_at: "Cancelada el"
|
|
115
|
+
detail_email: "Correo electrónico"
|
|
116
|
+
detail_expires_at: "Expira el"
|
|
117
|
+
detail_invited_by: "Invitado por"
|
|
118
|
+
detail_message: "Mensaje personal"
|
|
119
|
+
detail_name: "Nombre"
|
|
120
|
+
detail_recipient: "Destinatario"
|
|
121
|
+
detail_role: "Rol asignado"
|
|
122
|
+
detail_sent_at: "Enviada el"
|
|
123
|
+
detail_title: "Invitación para %{recipient}"
|
|
124
|
+
email_deleted: "Un usuario eliminado ya utiliza este correo electrónico."
|
|
125
|
+
email_existing_without_account: "Este correo electrónico no puede ser invitado."
|
|
126
|
+
email_member: "Esta persona ya pertenece a la cuenta."
|
|
127
|
+
email_other_account: "Este correo electrónico pertenece a otra cuenta."
|
|
128
|
+
empty_action: "Crear una invitación"
|
|
129
|
+
empty_description: "Invita a la primera persona a unirse a esta organización."
|
|
130
|
+
empty_filtered_action: "Limpiar filtro"
|
|
131
|
+
empty_filtered_description: "Prueba otro estado o elimina el filtro activo."
|
|
132
|
+
empty_filtered_title: "Ninguna invitación coincide con este filtro"
|
|
133
|
+
empty_title: "Aún no hay invitaciones"
|
|
134
|
+
field_email: "Correo electrónico"
|
|
135
|
+
field_message: "Mensaje personal"
|
|
136
|
+
field_message_hint: "Este mensaje se incluirá en el correo de invitación."
|
|
137
|
+
field_name: "Nombre"
|
|
138
|
+
field_name_hint: "Ayuda a tu equipo a identificar al destinatario antes de que acepte."
|
|
139
|
+
field_optional: "opcional"
|
|
140
|
+
field_role: "Rol"
|
|
141
|
+
filter_all: "Todas"
|
|
142
|
+
filters_label: "Filtrar invitaciones por estado"
|
|
143
|
+
invalid_status_transition: "Este cambio de estado de la invitación no está permitido."
|
|
144
|
+
mailer_action: "Aceptar invitación"
|
|
145
|
+
mailer_description: "Te han invitado a unirte a %{account}."
|
|
146
|
+
mailer_expiration: "Esta invitación vence el %{expiration}."
|
|
147
|
+
mailer_ignore_notice: "Si no esperabas esta invitación, puedes ignorar este correo de forma segura."
|
|
148
|
+
mailer_invited_by: "Invitación enviada por %{inviter}."
|
|
149
|
+
mailer_subject: "Te han invitado a Lesli"
|
|
150
|
+
mailer_title: "Has recibido una invitación"
|
|
151
|
+
new_description: "Elige al destinatario y el rol que recibirá después de aceptar."
|
|
152
|
+
new_title: "Nueva invitación"
|
|
153
|
+
not_acceptable: "Esta invitación ya no está disponible."
|
|
154
|
+
resent_successfully: "Invitación puesta en cola para su envío."
|
|
155
|
+
role_account_mismatch: "El rol seleccionado no pertenece a esta cuenta."
|
|
156
|
+
role_prompt: "Selecciona un rol"
|
|
157
|
+
role_required: "Selecciona un rol para esta invitación."
|
|
158
|
+
statuses_accepted: "Aceptada"
|
|
159
|
+
statuses_cancelled: "Cancelada"
|
|
160
|
+
statuses_expired: "Expirada"
|
|
161
|
+
statuses_pending: "Pendiente"
|
|
162
|
+
subtitle: "Invita personas a tu organización y consulta el estado de cada invitación."
|
|
163
|
+
title: "Invitaciones"
|
|
164
|
+
value_not_available: "No disponible"
|
|
165
|
+
items/attachments: {}
|
|
166
|
+
items/discussions: {}
|
|
167
|
+
items/tasks: {}
|
|
168
|
+
profile/passwords: {}
|
|
169
|
+
profiles:
|
|
170
|
+
time_zone: "Zona horaria"
|
|
171
|
+
time_zone_help: "Elige la zona horaria para mostrar e introducir fechas y horas."
|
|
172
|
+
time_zone_default: "Usar la zona horaria de la aplicación"
|
|
173
|
+
updated: "Perfil actualizado correctamente."
|
|
174
|
+
change_password: "Cambiar contraseña"
|
|
175
|
+
changing_password: "Cambiando contraseña…"
|
|
176
|
+
current_password: "Contraseña actual"
|
|
177
|
+
information: "Información"
|
|
178
|
+
new_password: "Nueva contraseña"
|
|
179
|
+
password_confirmation: "Confirmar nueva contraseña"
|
|
180
|
+
password_description: "Ingresa tu contraseña actual para elegir una nueva. Al cambiarla se cerrarán tus otras sesiones."
|
|
181
|
+
password_hint: "Tu contraseña debe contener entre %{minimum} y %{maximum} caracteres."
|
|
182
|
+
password_too_many_attempts: "Demasiados intentos de cambio de contraseña. Inténtalo de nuevo más tarde."
|
|
183
|
+
password_updated: "Tu contraseña fue cambiada correctamente."
|
|
184
|
+
security: "Seguridad"
|
|
185
|
+
role/actions: {}
|
|
186
|
+
roles:
|
|
187
|
+
action_create: "Crear rol"
|
|
188
|
+
action_delete: "Eliminar rol"
|
|
189
|
+
action_deleting: "Eliminando…"
|
|
190
|
+
action_duplicate: "Duplicar rol"
|
|
191
|
+
action_duplicating: "Duplicando…"
|
|
192
|
+
action_manage: "Administrar rol"
|
|
193
|
+
action_menu: "Acciones para %{role}"
|
|
194
|
+
action_permissions: "Administrar permisos"
|
|
195
|
+
action_saving: "Guardando…"
|
|
196
|
+
action_update: "Guardar cambios"
|
|
197
|
+
action_view: "Ver rol"
|
|
198
|
+
columns_actions: "Acciones"
|
|
199
|
+
columns_deployment: "Último deploy"
|
|
200
|
+
columns_modified_at: "Última modificación"
|
|
201
|
+
columns_permissions: "Permisos activos"
|
|
202
|
+
columns_role: "Rol y descripción"
|
|
203
|
+
columns_status: "Estado"
|
|
204
|
+
columns_users: "Usuarios"
|
|
205
|
+
confirm_delete: "¿Eliminar el rol %{role}? Esta acción no se puede deshacer."
|
|
206
|
+
created_successfully: "Rol creado correctamente."
|
|
207
|
+
deployment_statuses_deployed: "Aplicado"
|
|
208
|
+
deployment_statuses_never_deployed: "Nunca desplegado"
|
|
209
|
+
deployment_statuses_pending: "Cambios pendientes"
|
|
210
|
+
description_missing: "Sin descripción"
|
|
211
|
+
destroyed_successfully: "Rol eliminado correctamente."
|
|
212
|
+
detail_activate: "Activar rol"
|
|
213
|
+
detail_activating: "Activando…"
|
|
214
|
+
detail_active_impact_one: "Este rol está autorizando actualmente a 1 miembro. Al desactivarlo, esa persona perderá los accesos concedidos por este rol."
|
|
215
|
+
detail_active_impact_other: "Este rol está autorizando actualmente a %{count} miembros. Al desactivarlo, esas personas perderán los accesos concedidos por este rol."
|
|
216
|
+
detail_confirm_deactivate_one: "¿Desactivar %{role}? 1 miembro perderá inmediatamente los accesos concedidos por este rol."
|
|
217
|
+
detail_confirm_deactivate_other: "¿Desactivar %{role}? %{count} miembros perderán inmediatamente los accesos concedidos por este rol."
|
|
218
|
+
detail_deactivate: "Desactivar rol"
|
|
219
|
+
detail_deactivating: "Desactivando…"
|
|
220
|
+
detail_inactive_impact_one: "Este rol está inactivo. Su miembro conserva la asignación, pero el rol no concede acceso."
|
|
221
|
+
detail_inactive_impact_other: "Este rol está inactivo. Sus %{count} miembros conservan la asignación, pero el rol no concede acceso."
|
|
222
|
+
detail_manage_permissions: "Administrar permisos"
|
|
223
|
+
detail_members: "Miembros"
|
|
224
|
+
detail_permissions: "Permisos activos"
|
|
225
|
+
detail_status_title: "Estado y acceso"
|
|
226
|
+
detail_summary_title: "Resumen del rol"
|
|
227
|
+
detail_view_members: "Ver usuarios"
|
|
228
|
+
duplicated_successfully: "Se creó el rol %{role} como una copia inactiva."
|
|
229
|
+
empty_description: "Crea el primer rol para organizar usuarios y permisos de esta cuenta."
|
|
230
|
+
empty_filtered_action: "Limpiar filtros"
|
|
231
|
+
empty_filtered_description: "Prueba otra búsqueda o elimina los filtros activos."
|
|
232
|
+
empty_filtered_title: "Ningún rol coincide con los filtros"
|
|
233
|
+
empty_title: "Aún no hay roles disponibles"
|
|
234
|
+
errors_assigned_users: "No se puede eliminar un rol asignado a usuarios."
|
|
235
|
+
errors_duplicate_name: "ya está siendo utilizado por otro rol de esta cuenta"
|
|
236
|
+
errors_permission_level: "El nivel de permiso debe estar entre 0 y %{maximum}."
|
|
237
|
+
errors_protected_role: "El rol owner está protegido y no puede modificarse."
|
|
238
|
+
errors_system_role: "Los roles del sistema no pueden eliminarse."
|
|
239
|
+
errors_unknown_actions: "Acciones de permiso desconocidas o no disponibles: %{action_ids}."
|
|
240
|
+
fields_description: "Descripción"
|
|
241
|
+
fields_name: "Nombre"
|
|
242
|
+
fields_path_default: "Ruta inicial"
|
|
243
|
+
fields_permission_level: "Nivel de autorización"
|
|
244
|
+
fields_status: "Estado"
|
|
245
|
+
filters_clear_search: "Limpiar búsqueda"
|
|
246
|
+
filters_loading: "Filtrando…"
|
|
247
|
+
filters_search_label: "Buscar roles"
|
|
248
|
+
filters_search_placeholder: "Buscar por nombre o descripción"
|
|
249
|
+
filters_status_all: "Todos los estados"
|
|
250
|
+
filters_status_label: "Estado"
|
|
251
|
+
filters_submit: "Filtrar"
|
|
252
|
+
filters_type_all: "Todos los tipos"
|
|
253
|
+
filters_type_label: "Tipo"
|
|
254
|
+
form_cancel: "Cancelar"
|
|
255
|
+
form_description_hint: "Una descripción breve ayuda a los administradores a asignar el rol correcto."
|
|
256
|
+
form_errors_title: "Revisa los campos señalados"
|
|
257
|
+
form_path_default_hint: "Ruta a la que se enviará al usuario después de iniciar sesión."
|
|
258
|
+
form_permission_level_hint: "Ingresa un número entero entre 0 y %{maximum}. El rol no puede tener un nivel superior al tuyo."
|
|
259
|
+
form_protected_notice: "Este rol está protegido. Puedes consultar su configuración, pero no modificarla."
|
|
260
|
+
form_status_active_hint: "El rol podrá autorizar a sus miembros después de aplicar sus permisos."
|
|
261
|
+
form_status_inactive_hint: "Conserva su configuración, pero no autoriza a ningún miembro."
|
|
262
|
+
mobile_deployed_at: "Último deploy: %{date}"
|
|
263
|
+
mobile_modified_at: "Modificado: %{date}"
|
|
264
|
+
mobile_permissions_one: "1 permiso"
|
|
265
|
+
mobile_permissions_other: "%{count} permisos"
|
|
266
|
+
mobile_users_one: "1 usuario"
|
|
267
|
+
mobile_users_other: "%{count} usuarios"
|
|
268
|
+
new_description: "Define un nuevo rol para agrupar usuarios y configurar sus permisos."
|
|
269
|
+
new_title: "Crear rol"
|
|
270
|
+
pagination_label: "Paginación de roles"
|
|
271
|
+
pagination_next: "Siguiente"
|
|
272
|
+
pagination_page: "Página %{page} de %{pages}"
|
|
273
|
+
pagination_previous: "Anterior"
|
|
274
|
+
pagination_summary: "Mostrando %{count} de %{total} roles"
|
|
275
|
+
permissions_all_engines: "Todos los módulos"
|
|
276
|
+
permissions_clear_search: "Limpiar"
|
|
277
|
+
permissions_custom_actions: "Acciones personalizadas"
|
|
278
|
+
permissions_deploy: "Aplicar permisos (deploy)"
|
|
279
|
+
permissions_deployed: "Los permisos fueron aplicados correctamente."
|
|
280
|
+
permissions_empty: "No hay permisos disponibles en el catálogo."
|
|
281
|
+
permissions_engine_navigation: "Navegación por módulos"
|
|
282
|
+
permissions_engines: "Módulos"
|
|
283
|
+
permissions_module_summary: "%{selected} de %{total} permisos habilitados"
|
|
284
|
+
permissions_no_matches: "No encontramos permisos con esta búsqueda"
|
|
285
|
+
permissions_no_matches_hint: "Prueba con otro módulo, recurso o acción."
|
|
286
|
+
permissions_not_available: "No disponible"
|
|
287
|
+
permissions_resource: "Recurso"
|
|
288
|
+
permissions_search: "Buscar"
|
|
289
|
+
permissions_search_label: "Buscar permisos"
|
|
290
|
+
permissions_search_placeholder: "Buscar módulo, recurso o acción"
|
|
291
|
+
permissions_standard_actions_create: "Crear"
|
|
292
|
+
permissions_standard_actions_destroy: "Eliminar"
|
|
293
|
+
permissions_standard_actions_edit: "Editar"
|
|
294
|
+
permissions_standard_actions_index: "Listar"
|
|
295
|
+
permissions_standard_actions_new: "Nuevo"
|
|
296
|
+
permissions_standard_actions_show: "Ver"
|
|
297
|
+
permissions_standard_actions_update: "Actualizar"
|
|
298
|
+
permissions_states_disabled: "Deshabilitado"
|
|
299
|
+
permissions_states_enabled: "Habilitado"
|
|
300
|
+
permissions_title: "Permisos de %{role}"
|
|
301
|
+
permissions_toggle: "%{action}: %{state}"
|
|
302
|
+
permissions_tools: "Herramientas de permisos"
|
|
303
|
+
permissions_update_success: "Permiso actualizado correctamente."
|
|
304
|
+
statuses_active: "Activo"
|
|
305
|
+
statuses_inactive: "Inactivo"
|
|
306
|
+
subtitle: "Administra los roles de tu organización y define el acceso de cada equipo."
|
|
307
|
+
title: "Roles y permisos"
|
|
308
|
+
types_custom: "Personalizado"
|
|
309
|
+
types_system: "Sistema"
|
|
310
|
+
updated_successfully: "Rol actualizado correctamente."
|
|
311
|
+
sessions: {}
|
|
312
|
+
shared: {}
|
|
313
|
+
user/roles: {}
|
|
314
|
+
user/sessions: {}
|
|
315
|
+
user/settings: {}
|
|
316
|
+
user/shortcuts: {}
|
|
317
|
+
users: {}
|
data/config/routes.rb
CHANGED
|
@@ -46,6 +46,10 @@ LesliShield::Engine.routes.draw do
|
|
|
46
46
|
|
|
47
47
|
Lesli::Router.mount_lesli_engine_routes(self)
|
|
48
48
|
|
|
49
|
+
resource :profile, only: [:show, :update] do
|
|
50
|
+
resource :password, only: :update, module: :profile
|
|
51
|
+
end
|
|
52
|
+
|
|
49
53
|
resources :sessions, only: [:index, :show]
|
|
50
54
|
resources :users, only: [:index, :show, :update, :new, :create] do
|
|
51
55
|
|
|
@@ -70,12 +74,19 @@ LesliShield::Engine.routes.draw do
|
|
|
70
74
|
resources :roles, only: [:index, :show, :edit, :update, :new, :create, :destroy] do
|
|
71
75
|
member do
|
|
72
76
|
post :deploy
|
|
77
|
+
post :duplicate
|
|
73
78
|
end
|
|
74
79
|
scope module: :role do
|
|
75
|
-
resources :
|
|
76
|
-
|
|
80
|
+
resources :actions, only: [:index, :create, :destroy] do
|
|
81
|
+
get ":engine_slug", on: :collection, action: :index, as: :engine
|
|
82
|
+
end
|
|
77
83
|
end
|
|
78
84
|
end
|
|
79
85
|
|
|
80
|
-
resources :invites, only: [
|
|
86
|
+
resources :invites, only: %i[index show new create] do
|
|
87
|
+
member do
|
|
88
|
+
post :resend
|
|
89
|
+
patch :cancel
|
|
90
|
+
end
|
|
91
|
+
end
|
|
81
92
|
end
|
|
@@ -37,13 +37,47 @@ class CreateLesliShieldInvites < ActiveRecord::Migration[8.0]
|
|
|
37
37
|
t.string :full_name
|
|
38
38
|
t.string :telephone
|
|
39
39
|
t.text :notes
|
|
40
|
-
t.integer :status,
|
|
41
|
-
t.datetime :sent_at,
|
|
42
|
-
t.datetime :
|
|
43
|
-
t.datetime :
|
|
40
|
+
t.integer :status, null: false, default: 0, index: true
|
|
41
|
+
t.datetime :sent_at, index: true
|
|
42
|
+
t.datetime :expires_at, index: true
|
|
43
|
+
t.datetime :accepted_at, index: true
|
|
44
|
+
t.datetime :cancelled_at, index: true
|
|
45
|
+
t.datetime :deleted_at, index: true
|
|
44
46
|
t.timestamps
|
|
45
47
|
end
|
|
46
|
-
|
|
47
|
-
add_reference(
|
|
48
|
+
|
|
49
|
+
add_reference(
|
|
50
|
+
:lesli_shield_invites,
|
|
51
|
+
:account,
|
|
52
|
+
null: false,
|
|
53
|
+
foreign_key: { to_table: :lesli_shield_accounts }
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
add_reference(
|
|
57
|
+
:lesli_shield_invites,
|
|
58
|
+
:invited_by,
|
|
59
|
+
null: false,
|
|
60
|
+
foreign_key: { to_table: :lesli_users }
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
add_reference(
|
|
64
|
+
:lesli_shield_invites,
|
|
65
|
+
:role,
|
|
66
|
+
foreign_key: { to_table: :lesli_roles }
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
add_reference(
|
|
70
|
+
:lesli_shield_invites,
|
|
71
|
+
:accepted_user,
|
|
72
|
+
foreign_key: { to_table: :lesli_users }
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
add_index(
|
|
76
|
+
:lesli_shield_invites,
|
|
77
|
+
%i[account_id email],
|
|
78
|
+
unique: true,
|
|
79
|
+
where: "status = 0 AND deleted_at IS NULL",
|
|
80
|
+
name: "idx_shield_invites_unique_pending_email"
|
|
81
|
+
)
|
|
48
82
|
end
|
|
49
83
|
end
|
data/lib/lesli_shield/engine.rb
CHANGED
|
@@ -30,21 +30,59 @@ Building a better future, one line of code at a time.
|
|
|
30
30
|
// ·
|
|
31
31
|
=end
|
|
32
32
|
|
|
33
|
+
require "devise"
|
|
34
|
+
|
|
33
35
|
module LesliShield
|
|
34
36
|
class Engine < ::Rails::Engine
|
|
35
37
|
isolate_namespace LesliShield
|
|
36
38
|
|
|
39
|
+
# Rails 8 defers route loading in local environments. Load the main
|
|
40
|
+
# routes before the application starts accepting requests so Warden is
|
|
41
|
+
# initialized with the Devise mapping created by Shield's router.
|
|
42
|
+
config.after_initialize do |app|
|
|
43
|
+
app.routes_reloader.execute_unless_loaded
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
initializer "lesli_shield.authentication_routes" do
|
|
47
|
+
if Lesli::Router.respond_to?(:authentication_router=)
|
|
48
|
+
Lesli::Router.authentication_router = LesliShield::Router
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
37
52
|
config.to_prepare do
|
|
53
|
+
unless Lesli::User < LesliShield::UserAuthentication
|
|
54
|
+
Lesli::User.include(LesliShield::UserAuthentication)
|
|
55
|
+
end
|
|
56
|
+
|
|
38
57
|
unless Lesli::User < LesliShield::UserSecurity
|
|
39
58
|
Lesli::User.include(LesliShield::UserSecurity)
|
|
40
59
|
end
|
|
60
|
+
|
|
61
|
+
unless Lesli::Role < LesliShield::RoleManagement
|
|
62
|
+
Lesli::Role.include(LesliShield::RoleManagement)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Compatibility for core versions whose Devise base controller did
|
|
66
|
+
# not explicitly expose Lesli helpers to isolated engines.
|
|
67
|
+
devise_controller = Lesli::ApplicationDeviseController
|
|
68
|
+
core_helper_modules = [Lesli::SystemHelper, Lesli::HtmlHelper]
|
|
69
|
+
|
|
70
|
+
# The controller and layout live in Lesli, while Shield owns the
|
|
71
|
+
# specialized Devise forms. Put those forms before Devise's bundled
|
|
72
|
+
# defaults in the lookup order whenever Shield is installed.
|
|
73
|
+
shield_views = LesliShield::Engine.root.join("app", "views")
|
|
74
|
+
unless devise_controller.view_paths.first&.to_path == shield_views.to_s
|
|
75
|
+
devise_controller.prepend_view_path(shield_views)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
core_helper_modules.each do |helper_module|
|
|
79
|
+
next if devise_controller._helpers < helper_module
|
|
80
|
+
|
|
81
|
+
devise_controller.helper(helper_module)
|
|
82
|
+
end
|
|
41
83
|
end
|
|
42
84
|
|
|
43
85
|
initializer :lesli_shield do |app|
|
|
44
|
-
|
|
45
|
-
# register assets manifest
|
|
46
|
-
config.assets.precompile += %w[lesli_shield_manifest.js]
|
|
47
|
-
|
|
48
86
|
# register engine migrations path
|
|
49
87
|
unless app.root.to_s.match root.to_s
|
|
50
88
|
config.paths["db/migrate"].expanded.each do |expanded_path|
|
data/lib/lesli_shield/router.rb
CHANGED
|
@@ -1,21 +1,65 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module LesliShield
|
|
2
4
|
module Router
|
|
3
|
-
def self.mount_login_at(router, path="")
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
:
|
|
15
|
-
:
|
|
16
|
-
:
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
def self.mount_login_at(router, path = "")
|
|
6
|
+
# Devise derives and memoizes the mapping strategies while
|
|
7
|
+
# devise_for builds the routes. Install Shield's Devise modules
|
|
8
|
+
# first so a cold application boot cannot produce an empty mapping.
|
|
9
|
+
unless Lesli::User < LesliShield::UserAuthentication
|
|
10
|
+
Lesli::User.include(LesliShield::UserAuthentication)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
router.devise_for(
|
|
14
|
+
:users,
|
|
15
|
+
class_name: "Lesli::User",
|
|
16
|
+
module: :devise,
|
|
17
|
+
path: path,
|
|
18
|
+
path_names: {
|
|
19
|
+
sign_in: "login",
|
|
20
|
+
sign_out: "logout",
|
|
21
|
+
sign_up: "register",
|
|
22
|
+
password: "password",
|
|
23
|
+
confirmation: "confirmation"
|
|
24
|
+
},
|
|
25
|
+
controllers: {
|
|
26
|
+
registrations: "users/registrations",
|
|
27
|
+
confirmations: "users/confirmations",
|
|
28
|
+
passwords: "users/passwords",
|
|
29
|
+
sessions: "users/sessions"
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
router.get(
|
|
34
|
+
"#{path}/invitation",
|
|
35
|
+
to: "users/invitations#show",
|
|
36
|
+
as: :user_invitation
|
|
37
|
+
)
|
|
38
|
+
router.patch(
|
|
39
|
+
"#{path}/invitation",
|
|
40
|
+
to: "users/invitations#update"
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
configure_warden_user_mapping
|
|
19
44
|
end
|
|
20
|
-
|
|
45
|
+
|
|
46
|
+
def self.configure_warden_user_mapping
|
|
47
|
+
mapping = Devise.mappings.fetch(:user)
|
|
48
|
+
|
|
49
|
+
Devise.warden_config.scope_defaults(
|
|
50
|
+
mapping.name,
|
|
51
|
+
strategies: mapping.strategies
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
Devise.warden_config.serialize_into_session(mapping.name) do |record|
|
|
55
|
+
mapping.to.serialize_into_session(record)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
Devise.warden_config.serialize_from_session(mapping.name) do |args|
|
|
59
|
+
mapping.to.serialize_from_session(*args)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
private_class_method :configure_warden_user_mapping
|
|
64
|
+
end
|
|
21
65
|
end
|
data/lib/lesli_shield/version.rb
CHANGED
|
@@ -40,7 +40,7 @@ namespace :lesli_shield do
|
|
|
40
40
|
# Drop, build, migrate & seed database (development only)
|
|
41
41
|
def lesli_shield_privileges
|
|
42
42
|
Lesli::Role.all.each do |role|
|
|
43
|
-
LesliShield::RolePrivilegeService.new
|
|
43
|
+
LesliShield::RolePrivilegeService.new.rebuild!(role)
|
|
44
44
|
Termline.success("LesliShield: Syncing privileges for #{role.name} role.")
|
|
45
45
|
end
|
|
46
46
|
end
|
data/readme.md
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
<br />
|
|
9
9
|
|
|
10
10
|
<div align="center">
|
|
11
|
-
<a target="_blank" href="https://github.com/LesliTech/LesliShield/actions/workflows/lesli-ci-
|
|
12
|
-
<img alt="LesliShield test status" src="https://img.shields.io/github/actions/workflow/status/LesliTech/LesliShield/lesli-ci-
|
|
11
|
+
<a target="_blank" href="https://github.com/LesliTech/LesliShield/actions/workflows/lesli-ci-engine.yaml">
|
|
12
|
+
<img alt="LesliShield test status" src="https://img.shields.io/github/actions/workflow/status/LesliTech/LesliShield/lesli-ci-engine.yaml?branch=master&style=for-the-badge&logo=github&label=tests">
|
|
13
13
|
</a>
|
|
14
14
|
<a target="_blank" href="https://rubygems.org/gems/lesli_shield">
|
|
15
15
|
<img alt="Gem Version" src="https://img.shields.io/gem/v/lesli_shield?style=for-the-badge&logo=ruby">
|
|
@@ -46,6 +46,7 @@ It centralizes account security, role-based access control, and user onboarding
|
|
|
46
46
|
## Features
|
|
47
47
|
|
|
48
48
|
- Authentication and session management
|
|
49
|
+
- Self-service profile and password management
|
|
49
50
|
- Role-based access control
|
|
50
51
|
- Permission and privilege administration
|
|
51
52
|
- Account-scoped security policies
|
|
@@ -134,7 +135,19 @@ From a complete Lesli development workspace, run the engine test suite from the
|
|
|
134
135
|
|
|
135
136
|
```shell
|
|
136
137
|
cd engines/LesliShield
|
|
137
|
-
|
|
138
|
+
bundle exec rake test
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
The standalone suite does not require LesliAudit or LesliBell. Test account
|
|
142
|
+
helpers initialize those workspaces only when the engines are loaded. Tests
|
|
143
|
+
that inspect persisted audit events are skipped without LesliAudit; role CRUD,
|
|
144
|
+
permission checks, privilege compilation, and rollback tests still run.
|
|
145
|
+
|
|
146
|
+
To verify audit persistence with the optional engines installed, run from the
|
|
147
|
+
LesliBuilder root using its bundle and a dedicated test database:
|
|
148
|
+
|
|
149
|
+
```shell
|
|
150
|
+
RAILS_ENV=test bundle exec bin/rails test engines/LesliShield/test/services/lesli_shield/role_audit_test.rb engines/LesliShield/test/services/lesli_shield/role_privilege_deployment_service_test.rb
|
|
138
151
|
```
|
|
139
152
|
|
|
140
153
|
<br />
|
|
@@ -143,6 +156,7 @@ bin/rails test
|
|
|
143
156
|
|
|
144
157
|
- [Lesli website](https://www.lesli.dev/)
|
|
145
158
|
- [Documentation](https://www.lesli.dev/engines/shield)
|
|
159
|
+
- [User profile](https://www.lesli.dev/engines/shield/profile/overview)
|
|
146
160
|
- [Release notes](https://github.com/LesliTech/LesliShield/releases)
|
|
147
161
|
- [Issue tracker](https://github.com/LesliTech/LesliShield/issues)
|
|
148
162
|
- [Source code](https://github.com/LesliTech/LesliShield)
|