lesli_security 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +38 -0
- data/app/assets/config/lesli_security_manifest.js +38 -0
- data/app/assets/images/lesli_security/security-logo.svg +57 -0
- data/app/assets/javascripts/lesli_security/application.js +5583 -0
- data/app/assets/stylesheets/lesli_security/application.css +95 -0
- data/app/controllers/lesli_security/accounts_controller.rb +60 -0
- data/app/controllers/lesli_security/application_controller.rb +37 -0
- data/app/controllers/lesli_security/dashboard/components_controller.rb +60 -0
- data/app/controllers/lesli_security/dashboards_controller.rb +36 -0
- data/app/controllers/lesli_security/descriptor/activities_controller.rb +122 -0
- data/app/controllers/lesli_security/descriptor/privileges_controller.rb +112 -0
- data/app/controllers/lesli_security/descriptors_controller.rb +129 -0
- data/app/controllers/lesli_security/role/activities_controller.rb +76 -0
- data/app/controllers/lesli_security/role/descriptors_controller.rb +97 -0
- data/app/controllers/lesli_security/role/privileges_controller.rb +47 -0
- data/app/controllers/lesli_security/roles_controller.rb +185 -0
- data/app/controllers/lesli_security/user/roles_controller.rb +98 -0
- data/app/controllers/lesli_security/user/sessions_controller.rb +71 -0
- data/app/controllers/lesli_security/users_controller.rb +206 -0
- data/app/helpers/lesli_security/accounts_helper.rb +4 -0
- data/app/helpers/lesli_security/application_helper.rb +4 -0
- data/app/helpers/lesli_security/dashboards_helper.rb +4 -0
- data/app/helpers/lesli_security/descriptor/activities_helper.rb +4 -0
- data/app/helpers/lesli_security/descriptor/privileges_helper.rb +4 -0
- data/app/helpers/lesli_security/descriptors_helper.rb +4 -0
- data/app/helpers/lesli_security/role/activities_helper.rb +4 -0
- data/app/helpers/lesli_security/role/descriptors_helper.rb +4 -0
- data/app/helpers/lesli_security/role/privileges_helper.rb +4 -0
- data/app/helpers/lesli_security/roles_helper.rb +4 -0
- data/app/jobs/lesli_security/application_job.rb +37 -0
- data/app/mailers/lesli_security/application_mailer.rb +39 -0
- data/app/models/lesli_security/account.rb +43 -0
- data/app/models/lesli_security/application_record.rb +37 -0
- data/app/models/lesli_security/dashboard/component.rb +42 -0
- data/app/models/lesli_security/dashboard.rb +58 -0
- data/app/models/lesli_security/descriptor/activity.rb +40 -0
- data/app/models/lesli_security/descriptor/privilege.rb +40 -0
- data/app/models/lesli_security/descriptor.rb +41 -0
- data/app/models/lesli_security/role/activity.rb +40 -0
- data/app/services/lesli_security/descriptor_privilege_service.rb +74 -0
- data/app/services/lesli_security/descriptor_service.rb +152 -0
- data/app/services/lesli_security/role_descriptor_service.rb +61 -0
- data/app/services/lesli_security/role_service.rb +215 -0
- data/app/services/lesli_security/user_service.rb +305 -0
- data/app/views/lesli_security/accounts/_account.html.erb +2 -0
- data/app/views/lesli_security/accounts/_form.html.erb +17 -0
- data/app/views/lesli_security/accounts/edit.html.erb +10 -0
- data/app/views/lesli_security/accounts/index.html.erb +14 -0
- data/app/views/lesli_security/accounts/new.html.erb +9 -0
- data/app/views/lesli_security/accounts/show.html.erb +10 -0
- data/app/views/lesli_security/dashboards/show.html.erb +1 -0
- data/app/views/lesli_security/descriptor/activities/_form.html.erb +32 -0
- data/app/views/lesli_security/descriptor/activities/edit.html.erb +34 -0
- data/app/views/lesli_security/descriptor/activities/index.html.erb +34 -0
- data/app/views/lesli_security/descriptor/activities/new.html.erb +34 -0
- data/app/views/lesli_security/descriptor/activities/show.html.erb +34 -0
- data/app/views/lesli_security/descriptor/privileges/_form.html.erb +32 -0
- data/app/views/lesli_security/descriptor/privileges/edit.html.erb +34 -0
- data/app/views/lesli_security/descriptor/privileges/index.html.erb +34 -0
- data/app/views/lesli_security/descriptor/privileges/new.html.erb +34 -0
- data/app/views/lesli_security/descriptor/privileges/show.html.erb +34 -0
- data/app/views/lesli_security/descriptors/_form.html.erb +32 -0
- data/app/views/lesli_security/descriptors/edit.html.erb +34 -0
- data/app/views/lesli_security/descriptors/index.html.erb +34 -0
- data/app/views/lesli_security/descriptors/new.html.erb +34 -0
- data/app/views/lesli_security/descriptors/show.html.erb +34 -0
- data/app/views/lesli_security/partials/_engine-navigation.html.erb +38 -0
- data/app/views/lesli_security/role/activities/_form.html.erb +32 -0
- data/app/views/lesli_security/role/activities/edit.html.erb +34 -0
- data/app/views/lesli_security/role/activities/index.html.erb +34 -0
- data/app/views/lesli_security/role/activities/new.html.erb +34 -0
- data/app/views/lesli_security/role/activities/show.html.erb +34 -0
- data/app/views/lesli_security/role/descriptors/_form.html.erb +32 -0
- data/app/views/lesli_security/role/descriptors/edit.html.erb +34 -0
- data/app/views/lesli_security/role/descriptors/index.html.erb +34 -0
- data/app/views/lesli_security/role/descriptors/new.html.erb +34 -0
- data/app/views/lesli_security/role/descriptors/show.html.erb +34 -0
- data/app/views/lesli_security/role/privileges/_form.html.erb +32 -0
- data/app/views/lesli_security/role/privileges/edit.html.erb +34 -0
- data/app/views/lesli_security/role/privileges/index.html.erb +34 -0
- data/app/views/lesli_security/role/privileges/new.html.erb +34 -0
- data/app/views/lesli_security/role/privileges/show.html.erb +34 -0
- data/app/views/lesli_security/roles/edit.html.erb +34 -0
- data/app/views/lesli_security/roles/index.html.erb +34 -0
- data/app/views/lesli_security/roles/new.html.erb +34 -0
- data/app/views/lesli_security/roles/show.html.erb +34 -0
- data/app/views/lesli_security/users/edit.html.erb +10 -0
- data/app/views/lesli_security/users/index.html.erb +34 -0
- data/app/views/lesli_security/users/new.html.erb +34 -0
- data/app/views/lesli_security/users/show.html.erb +1 -0
- data/config/locales/translations.en.yml +44 -0
- data/config/locales/translations.es.yml +44 -0
- data/config/locales/translations.fr.yml +44 -0
- data/config/locales/translations.it.yml +44 -0
- data/config/locales/translations.pt.yml +44 -0
- data/config/routes.rb +90 -0
- data/db/migrate/v1/0010000210_create_lesli_roles.rb +60 -0
- data/db/migrate/v1/0010000310_create_lesli_users.rb +97 -0
- data/db/migrate/v1/0010003010_create_lesli_user_details.rb +49 -0
- data/db/migrate/v1/0010003110_create_lesli_user_settings.rb +44 -0
- data/db/migrate/v1/0010003210_create_lesli_user_sessions.rb +55 -0
- data/db/migrate/v1/0010003410_create_lesli_user_powers.rb +43 -0
- data/db/migrate/v1/0010004010_create_lesli_user_logs.rb +45 -0
- data/db/migrate/v1/0010005010_create_lesli_descriptors.rb +44 -0
- data/db/migrate/v1/0010005110_create_lesli_descriptor_privileges.rb +45 -0
- data/db/migrate/v1/0010005210_create_lesli_descriptor_activities.rb +49 -0
- data/db/migrate/v1/0010005510_create_lesli_role_powers.rb +51 -0
- data/db/migrate/v1/0010005710_create_lesli_role_privileges.rb +45 -0
- data/db/migrate/v1/0802000110_create_lesli_security_accounts.rb +42 -0
- data/db/migrate/v1/0802050110_create_lesli_security_dashboards.rb +51 -0
- data/db/migrate/v1/0802050210_create_lesli_security_dashboard_components.rb +53 -0
- data/lib/lesli_security/engine.rb +18 -0
- data/lib/lesli_security/version.rb +4 -0
- data/lib/lesli_security.rb +6 -0
- data/lib/scss/application.scss +38 -0
- data/lib/scss/users.scss +67 -0
- data/lib/tasks/lesli_security_tasks.rake +50 -0
- data/lib/vue/application.js +112 -0
- data/lib/vue/apps/descriptors/components/form.vue +136 -0
- data/lib/vue/apps/descriptors/edit.vue +83 -0
- data/lib/vue/apps/descriptors/index.vue +113 -0
- data/lib/vue/apps/descriptors/new.vue +69 -0
- data/lib/vue/apps/descriptors/show.vue +233 -0
- data/lib/vue/apps/roles/components/descriptors.vue +81 -0
- data/lib/vue/apps/roles/components/form.vue +253 -0
- data/lib/vue/apps/roles/components/privilegeCustom.vue +86 -0
- data/lib/vue/apps/roles/components/privilegeStandard.vue +196 -0
- data/lib/vue/apps/roles/edit.vue +118 -0
- data/lib/vue/apps/roles/index.vue +168 -0
- data/lib/vue/apps/roles/logs.vue +110 -0
- data/lib/vue/apps/roles/new.vue +86 -0
- data/lib/vue/apps/roles/show.vue +109 -0
- data/lib/vue/apps/users/components/information-card.vue +104 -0
- data/lib/vue/apps/users/components/information-form.vue +176 -0
- data/lib/vue/apps/users/components/integrations-information.vue +61 -0
- data/lib/vue/apps/users/components/management-roles.vue +107 -0
- data/lib/vue/apps/users/components/management-security.vue +113 -0
- data/lib/vue/apps/users/components/management-sessions.vue +101 -0
- data/lib/vue/apps/users/components/management-settings.vue +93 -0
- data/lib/vue/apps/users/index.vue +207 -0
- data/lib/vue/apps/users/new.vue +181 -0
- data/lib/vue/apps/users/show.vue +131 -0
- data/lib/vue/stores/descriptor.js +117 -0
- data/lib/vue/stores/descriptors.js +156 -0
- data/lib/vue/stores/role.js +203 -0
- data/lib/vue/stores/roles.js +58 -0
- data/lib/vue/stores/translations.json +277 -0
- data/lib/vue/stores/user.js +331 -0
- data/lib/vue/stores/users.js +166 -0
- data/license +674 -0
- data/readme.md +76 -0
- metadata +225 -0
@@ -0,0 +1,176 @@
|
|
1
|
+
<script setup>
|
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 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
|
+
|
33
|
+
|
34
|
+
// · import vue tools
|
35
|
+
import { onMounted, inject } from "vue"
|
36
|
+
|
37
|
+
|
38
|
+
// · import lesli stores
|
39
|
+
import { useUser } from "LesliSecurity/vue/stores/user"
|
40
|
+
|
41
|
+
|
42
|
+
// · import vue router composable
|
43
|
+
import { useRouter, useRoute } from "vue-router"
|
44
|
+
|
45
|
+
|
46
|
+
// · implement stores
|
47
|
+
const storeUser = useUser()
|
48
|
+
|
49
|
+
|
50
|
+
// · initialize/inject plugins
|
51
|
+
const router = useRouter()
|
52
|
+
const route = useRoute()
|
53
|
+
const url = inject("url")
|
54
|
+
|
55
|
+
|
56
|
+
// ·
|
57
|
+
const translations = {
|
58
|
+
guard: {
|
59
|
+
users: i18n.t("lesli_security.users")
|
60
|
+
},
|
61
|
+
lesli: {
|
62
|
+
shared: i18n.t("lesli.shared")
|
63
|
+
},
|
64
|
+
users: I18n.t("core.users"),
|
65
|
+
shared: I18n.t("core.shared")
|
66
|
+
}
|
67
|
+
|
68
|
+
</script>
|
69
|
+
<template>
|
70
|
+
<lesli-form flat @submit="storeUser.putUser()">
|
71
|
+
|
72
|
+
<div class="field is-horizontal">
|
73
|
+
<div class="field-label is-normal">
|
74
|
+
<label class="label">
|
75
|
+
{{ translations.guard.users.column_email }}
|
76
|
+
<span class="is-danger">*</span>
|
77
|
+
</label>
|
78
|
+
</div>
|
79
|
+
<div class="field-body">
|
80
|
+
<div class="field">
|
81
|
+
<div class="control">
|
82
|
+
<input name="user_email" v-model="storeUser.user.email" required="required" type="email" class="input">
|
83
|
+
</div>
|
84
|
+
</div>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
<div class="field is-horizontal">
|
89
|
+
<div class="field-label is-normal">
|
90
|
+
<label class="label">
|
91
|
+
{{ translations.guard.users.column_first_name }}
|
92
|
+
</label>
|
93
|
+
</div>
|
94
|
+
<div class="field-body">
|
95
|
+
<div class="field">
|
96
|
+
<div class="control">
|
97
|
+
<input name="first_name" v-model="storeUser.user.first_name" type="text" class="input">
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
</div>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
<div class="field is-horizontal">
|
104
|
+
<div class="field-label is-normal">
|
105
|
+
<label class="label">
|
106
|
+
{{ translations.guard.users.column_last_name }}
|
107
|
+
</label>
|
108
|
+
</div>
|
109
|
+
<div class="field-body">
|
110
|
+
<div class="field">
|
111
|
+
<div class="control">
|
112
|
+
<input name="last_name" v-model="storeUser.user.last_name" class="input">
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
<div class="field is-horizontal">
|
119
|
+
<div class="field-label is-normal">
|
120
|
+
<label class="label">
|
121
|
+
{{ translations.guard.users.column_alias }}
|
122
|
+
</label>
|
123
|
+
</div>
|
124
|
+
<div class="field-body">
|
125
|
+
<div class="field">
|
126
|
+
<div class="control">
|
127
|
+
<input name="user_alias" v-model="storeUser.user.alias" class="input">
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
</div>
|
131
|
+
</div>
|
132
|
+
|
133
|
+
<div class="field is-horizontal">
|
134
|
+
<div class="field-label is-normal">
|
135
|
+
<label class="label">
|
136
|
+
{{ translations.guard.users.column_telephone }}
|
137
|
+
</label>
|
138
|
+
</div>
|
139
|
+
<div class="field-body">
|
140
|
+
<div class="field">
|
141
|
+
<div class="control">
|
142
|
+
<input name="user_number" v-model="storeUser.user.telephone" class="input">
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
</div>
|
146
|
+
</div>
|
147
|
+
|
148
|
+
<div class="field is-horizontal">
|
149
|
+
<div class="field-label is-normal">
|
150
|
+
<label class="label">
|
151
|
+
{{ translations.guard.users.column_title }}
|
152
|
+
</label>
|
153
|
+
</div>
|
154
|
+
<div class="field-body">
|
155
|
+
<div class="field">
|
156
|
+
<div class="control">
|
157
|
+
<input name="user_title" v-model="storeUser.user.detail_attributes.title" class="input">
|
158
|
+
</div>
|
159
|
+
</div>
|
160
|
+
</div>
|
161
|
+
</div>
|
162
|
+
<div class="field is-horizontal">
|
163
|
+
<div class="field-label is-normal">
|
164
|
+
</div>
|
165
|
+
<div class="field-body">
|
166
|
+
<div class="field">
|
167
|
+
<div class="control">
|
168
|
+
<lesli-button icon="save">
|
169
|
+
{{ translations.lesli.shared.button_save }}
|
170
|
+
</lesli-button>
|
171
|
+
</div>
|
172
|
+
</div>
|
173
|
+
</div>
|
174
|
+
</div>
|
175
|
+
</lesli-form>
|
176
|
+
</template>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<script setup>
|
2
|
+
/*
|
3
|
+
|
4
|
+
Lesli
|
5
|
+
|
6
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
7
|
+
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
9
|
+
it under the terms of the GNU General Public License as published by
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
11
|
+
(at your option) any later version.
|
12
|
+
|
13
|
+
This program is distributed in the hope that it will be useful,
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
GNU General Public License for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU General Public License
|
19
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
20
|
+
|
21
|
+
Lesli · Your Smart Business Assistant.
|
22
|
+
|
23
|
+
Made with ♥ by https://www.lesli.tech
|
24
|
+
Building a better future, one line of code at a time.
|
25
|
+
|
26
|
+
@contact hello@lesli.tech
|
27
|
+
@website https://lesli.tech
|
28
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
29
|
+
|
30
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
31
|
+
// ·
|
32
|
+
|
33
|
+
*/
|
34
|
+
|
35
|
+
|
36
|
+
import { useProfile } from "Lesli/vue/shared/stores/profile"
|
37
|
+
|
38
|
+
const storeProfile = useProfile()
|
39
|
+
|
40
|
+
const translations = {
|
41
|
+
core: {
|
42
|
+
roles: I18n.t("core.roles"),
|
43
|
+
users: I18n.t("core.users"),
|
44
|
+
shared: I18n.t("core.shared")
|
45
|
+
}
|
46
|
+
}
|
47
|
+
</script>
|
48
|
+
<template>
|
49
|
+
<section class="application-component">
|
50
|
+
<div class="field is-horizontal">
|
51
|
+
<div class="field-label is-normal">
|
52
|
+
<label class="label">Google account</label>
|
53
|
+
</div>
|
54
|
+
<div class="field-body">
|
55
|
+
<lesli-button icon="google">
|
56
|
+
<a href="/auth/google_oauth2">Connect</a>
|
57
|
+
</lesli-button>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
</section>
|
61
|
+
</template>
|
@@ -0,0 +1,107 @@
|
|
1
|
+
<script setup>
|
2
|
+
/*
|
3
|
+
|
4
|
+
Lesli
|
5
|
+
|
6
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
7
|
+
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
9
|
+
it under the terms of the GNU General Public License as published by
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
11
|
+
(at your option) any later version.
|
12
|
+
|
13
|
+
This program is distributed in the hope that it will be useful,
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
GNU General Public License for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU General Public License
|
19
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
20
|
+
|
21
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
22
|
+
|
23
|
+
Made with ♥ by https://www.lesli.tech
|
24
|
+
Building a better future, one line of code at a time.
|
25
|
+
|
26
|
+
@contact hello@lesli.tech
|
27
|
+
@website https://www.lesli.tech
|
28
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
29
|
+
|
30
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
31
|
+
// ·
|
32
|
+
*/
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
// · import vue tools
|
37
|
+
import { ref, reactive, onMounted, watch, computed } from "vue"
|
38
|
+
|
39
|
+
|
40
|
+
// · import lesli stores
|
41
|
+
import { useUser } from "LesliSecurity/vue/stores/user"
|
42
|
+
import { useRoles } from "LesliSecurity/vue/stores/roles"
|
43
|
+
|
44
|
+
|
45
|
+
// · implement stores
|
46
|
+
const storeUser = useUser()
|
47
|
+
const storeRoles = useRoles()
|
48
|
+
|
49
|
+
|
50
|
+
// ·
|
51
|
+
const translations = {
|
52
|
+
shared: I18n.t("core.shared"),
|
53
|
+
passwords: I18n.t("core.users/passwords"),
|
54
|
+
users: I18n.t("core.users")
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
// ·
|
59
|
+
function updateRole(role){
|
60
|
+
if (role.active) {
|
61
|
+
storeUser.postRole(role)
|
62
|
+
} else {
|
63
|
+
storeUser.deleteRole(role)
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
// ·
|
69
|
+
onMounted(() => {
|
70
|
+
storeUser.getRoles()
|
71
|
+
})
|
72
|
+
</script>
|
73
|
+
<template>
|
74
|
+
<div class="media px-6" v-for="role in storeUser.roles">
|
75
|
+
<div class="media-content pt-4">
|
76
|
+
<h4>{{ role.name }}</h4>
|
77
|
+
<p style="color:#aaa;">
|
78
|
+
{{ role.description }}
|
79
|
+
</p>
|
80
|
+
</div>
|
81
|
+
<div class="media-right pt-4">
|
82
|
+
<lesli-toggle v-model="role.active" @change="updateRole(role)">
|
83
|
+
</lesli-toggle>
|
84
|
+
</div>
|
85
|
+
</div>
|
86
|
+
<lesli-empty v-if="storeUser.roles.length == 0"></lesli-empty>
|
87
|
+
<!--
|
88
|
+
<div class="roles-types">
|
89
|
+
<div
|
90
|
+
class="card roles-types-item p-4 is-flex is-flex-direction-column is-justify-content-space-between is-clickable"
|
91
|
+
v-for="role in storeUser.options.roles"
|
92
|
+
:key="role">
|
93
|
+
<div class="role-type-title">
|
94
|
+
<span class="has-text-weight-semibold is-size-5 ">
|
95
|
+
{{ role.name }}
|
96
|
+
</span>
|
97
|
+
</div>
|
98
|
+
<div>
|
99
|
+
<span>Permission level: {{ role.object_level_permission }} </span>
|
100
|
+
</div>
|
101
|
+
<div class="is-flex is-justify-content-space-between is-align-items-center">
|
102
|
+
<lesli-toggle v-model="storeUser.rolesToggle[role.id]" v-on:update:modelValue="updateRole(role,storeUser.rolesToggle[role.id])" ></lesli-toggle>
|
103
|
+
</div>
|
104
|
+
</div>
|
105
|
+
</div>
|
106
|
+
-->
|
107
|
+
</template>
|
@@ -0,0 +1,113 @@
|
|
1
|
+
<script setup>
|
2
|
+
/*
|
3
|
+
|
4
|
+
Lesli
|
5
|
+
|
6
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
7
|
+
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
9
|
+
it under the terms of the GNU General Public License as published by
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
11
|
+
(at your option) any later version.
|
12
|
+
|
13
|
+
This program is distributed in the hope that it will be useful,
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
GNU General Public License for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU General Public License
|
19
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
20
|
+
|
21
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
22
|
+
|
23
|
+
Made with ♥ by https://www.lesli.tech
|
24
|
+
Building a better future, one line of code at a time.
|
25
|
+
|
26
|
+
@contact hello@lesli.tech
|
27
|
+
@website https://www.lesli.tech
|
28
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
29
|
+
|
30
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
31
|
+
// ·
|
32
|
+
*/
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
// · import lesli stores
|
37
|
+
import { useUser } from "LesliSecurity/vue/stores/user"
|
38
|
+
|
39
|
+
|
40
|
+
// · implement stores
|
41
|
+
const storeUser = useUser()
|
42
|
+
|
43
|
+
|
44
|
+
// · translations
|
45
|
+
const translations = {
|
46
|
+
users: I18n.t("core.users"),
|
47
|
+
shared: I18n.t("core.shared")
|
48
|
+
}
|
49
|
+
|
50
|
+
|
51
|
+
</script>
|
52
|
+
<template>
|
53
|
+
<div>
|
54
|
+
<fieldset class="mb-4">
|
55
|
+
<legend>Force the user to change the password</legend>
|
56
|
+
<lesli-button
|
57
|
+
icon="lock_reset"
|
58
|
+
@click="storeUser.doRequestPassword">
|
59
|
+
{{ translations.users.view_btn_request_password || "Request password" }}
|
60
|
+
</lesli-button>
|
61
|
+
</fieldset>
|
62
|
+
|
63
|
+
<fieldset class="mb-4">
|
64
|
+
<legend>Generate a new password for the user</legend>
|
65
|
+
<lesli-button
|
66
|
+
icon="key"
|
67
|
+
@click="storeUser.doPasswordReset">
|
68
|
+
{{ translations.users.view_btn_password_reset || "Password reset" }}
|
69
|
+
</lesli-button>
|
70
|
+
</fieldset>
|
71
|
+
|
72
|
+
<fieldset class="mb-4">
|
73
|
+
<legend>Close all the active sessions of the user</legend>
|
74
|
+
<lesli-button
|
75
|
+
icon="logout"
|
76
|
+
@click="storeUser.doLogout">
|
77
|
+
{{ translations.users.view_btn_logout }}
|
78
|
+
</lesli-button>
|
79
|
+
</fieldset>
|
80
|
+
|
81
|
+
<fieldset class="mb-4">
|
82
|
+
<legend>Remove all user access</legend>
|
83
|
+
<lesli-button
|
84
|
+
danger
|
85
|
+
icon="lock_outline"
|
86
|
+
@click="storeUser.doRevokeAccess">
|
87
|
+
{{ translations.users.view_btn_revoke_access }}
|
88
|
+
</lesli-button>
|
89
|
+
</fieldset>
|
90
|
+
|
91
|
+
<br><br>
|
92
|
+
|
93
|
+
<fieldset class="mb-4">
|
94
|
+
<legend>Delete user forever</legend>
|
95
|
+
<lesli-button
|
96
|
+
danger
|
97
|
+
icon="delete_forever"
|
98
|
+
@click="storeUser.deleteUser">
|
99
|
+
{{ translations.users.view_btn_delete_user }}
|
100
|
+
</lesli-button>
|
101
|
+
</fieldset>
|
102
|
+
</div>
|
103
|
+
</template>
|
104
|
+
<style scoped>
|
105
|
+
fieldset {
|
106
|
+
padding: 1.6rem;
|
107
|
+
border: 1px solid #ccc;
|
108
|
+
border-radius: 4px;
|
109
|
+
}
|
110
|
+
legend {
|
111
|
+
color: #555;
|
112
|
+
}
|
113
|
+
</style>
|
@@ -0,0 +1,101 @@
|
|
1
|
+
<script setup>
|
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 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
|
+
|
33
|
+
|
34
|
+
// · import vue tools
|
35
|
+
import { ref, reactive, onMounted, watch, computed } from "vue"
|
36
|
+
|
37
|
+
|
38
|
+
// · import vue router composable
|
39
|
+
import { useRoute } from "vue-router"
|
40
|
+
|
41
|
+
|
42
|
+
// · import lesli stores
|
43
|
+
import { useUser } from "LesliSecurity/vue/stores/user"
|
44
|
+
|
45
|
+
|
46
|
+
// · implement stores
|
47
|
+
const storeUser = useUser()
|
48
|
+
|
49
|
+
|
50
|
+
// · initialize/inject plugins
|
51
|
+
const route = useRoute()
|
52
|
+
|
53
|
+
|
54
|
+
// ·
|
55
|
+
const translations = {
|
56
|
+
users: I18n.t("core.users"),
|
57
|
+
shared: i18n.t("lesli.shared")
|
58
|
+
}
|
59
|
+
|
60
|
+
|
61
|
+
// ·
|
62
|
+
const columns = [{
|
63
|
+
field: 'id',
|
64
|
+
label: 'ID'
|
65
|
+
}, {
|
66
|
+
field: 'device',
|
67
|
+
label: 'Device'
|
68
|
+
}, {
|
69
|
+
field: 'session_source',
|
70
|
+
label: 'Source'
|
71
|
+
}, {
|
72
|
+
field: 'created_at_string',
|
73
|
+
label: 'Created at'
|
74
|
+
}, {
|
75
|
+
field: 'expiration_at_string',
|
76
|
+
label: 'Expiration at'
|
77
|
+
}]
|
78
|
+
|
79
|
+
|
80
|
+
// ·
|
81
|
+
onMounted(() => {
|
82
|
+
storeUser.fetchSessions()
|
83
|
+
})
|
84
|
+
|
85
|
+
</script>
|
86
|
+
<template>
|
87
|
+
<lesli-toolbar>
|
88
|
+
<lesli-button icon="refresh">
|
89
|
+
Reload
|
90
|
+
</lesli-button>
|
91
|
+
</lesli-toolbar>
|
92
|
+
<lesli-table
|
93
|
+
:columns="columns"
|
94
|
+
:records="storeUser.sessions.records">
|
95
|
+
<template #buttons="{ record, value }">
|
96
|
+
<lesli-button small danger icon="delete" @click="storeUser.deleteSession(record.id)">
|
97
|
+
{{ translations.shared.button_delete }}
|
98
|
+
</lesli-button>
|
99
|
+
</template>
|
100
|
+
</lesli-table>
|
101
|
+
</template>
|
@@ -0,0 +1,93 @@
|
|
1
|
+
<script setup>
|
2
|
+
/*
|
3
|
+
|
4
|
+
Lesli
|
5
|
+
|
6
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
7
|
+
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
9
|
+
it under the terms of the GNU General Public License as published by
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
11
|
+
(at your option) any later version.
|
12
|
+
|
13
|
+
This program is distributed in the hope that it will be useful,
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
GNU General Public License for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU General Public License
|
19
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
20
|
+
|
21
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
22
|
+
|
23
|
+
Made with ♥ by https://www.lesli.tech
|
24
|
+
Building a better future, one line of code at a time.
|
25
|
+
|
26
|
+
@contact hello@lesli.tech
|
27
|
+
@website https://www.lesli.tech
|
28
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
29
|
+
|
30
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
31
|
+
// ·
|
32
|
+
*/
|
33
|
+
|
34
|
+
|
35
|
+
// · import vue tools
|
36
|
+
import { ref, reactive, onMounted, watch, computed } from "vue"
|
37
|
+
|
38
|
+
|
39
|
+
// · import lesli stores
|
40
|
+
import { useUser } from "LesliSecurity/vue/stores/user"
|
41
|
+
|
42
|
+
|
43
|
+
// · implement stores
|
44
|
+
const storeUser = useUser()
|
45
|
+
|
46
|
+
|
47
|
+
// · translations
|
48
|
+
const translations = {
|
49
|
+
users: I18n.t("core.users"),
|
50
|
+
shared: i18n.t("lesli.shared")
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
// · initializing
|
55
|
+
onMounted(() => {
|
56
|
+
//storeUser.getOptions()
|
57
|
+
})
|
58
|
+
</script>
|
59
|
+
<template>
|
60
|
+
<lesli-form flat @submit="storeUser.postLanguage">
|
61
|
+
<div class="field is-horizontal">
|
62
|
+
<div class="field-label">
|
63
|
+
<label class="label">Select preferred language </label>
|
64
|
+
</div>
|
65
|
+
<div class="field-body">
|
66
|
+
<div class="field is-narrow">
|
67
|
+
<div class="control">
|
68
|
+
<div class="select">
|
69
|
+
<lesli-select
|
70
|
+
icon="language"
|
71
|
+
v-model="storeUser.user.locale.value"
|
72
|
+
:options="storeUser.options.locales">
|
73
|
+
</lesli-select>
|
74
|
+
</div>
|
75
|
+
</div>
|
76
|
+
</div>
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
<div class="field is-horizontal">
|
80
|
+
<div class="field-label is-normal">
|
81
|
+
</div>
|
82
|
+
<div class="field-body">
|
83
|
+
<div class="field">
|
84
|
+
<div class="control">
|
85
|
+
<lesli-button icon="save">
|
86
|
+
{{ translations.shared.button_save }}
|
87
|
+
</lesli-button>
|
88
|
+
</div>
|
89
|
+
</div>
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
</lesli-form>
|
93
|
+
</template>
|