lesli_shield 1.1.12 → 1.1.13
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/db/migrate/v1/0801110110_create_lesli_shield_user_roles.rb +5 -2
- data/lib/lesli_shield/version.rb +2 -2
- data/readme.md +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4ac38461fdac0783a3f23e8de1baddd736ff061f7c6fbd7f108ebcea939b3362
|
|
4
|
+
data.tar.gz: d1e0c19c5fc360a1b4073b41e9d51a43f9dc4864d7112fbf5250aee14a687fda
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 46602c6fd77aa6e7d446c23efa3308d827f41cda319ec91fe9c8fc6541fca36cbc46bc3f97cafd2345bc3cf8f13b6df4fd980f8ab5f969b36cbb7cca1752a590
|
|
7
|
+
data.tar.gz: e33c3d916b9a8f3f0f6658e3c3eb8fd855c0fc8b5bfdc51b05ec36c7f3ce88de6144e4c9e0bb068da2ddd19550bbc432957d773266b45291a7b4956b5dabc3ff
|
|
@@ -37,7 +37,10 @@ class CreateLesliShieldUserRoles < ActiveRecord::Migration[6.0]
|
|
|
37
37
|
t.timestamps
|
|
38
38
|
end
|
|
39
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 })
|
|
40
|
+
add_reference(:lesli_shield_user_roles, :user, null: false, foreign_key: { to_table: :lesli_users })
|
|
41
|
+
add_reference(:lesli_shield_user_roles, :role, null: false, foreign_key: { to_table: :lesli_roles })
|
|
42
|
+
|
|
43
|
+
# Preserve removed assignments as history, but allow only one active pair.
|
|
44
|
+
add_index(:lesli_shield_user_roles, [:user_id, :role_id], unique: true, where: "deleted_at IS NULL", name: "idx_shield_user_roles_unique_active_assignment")
|
|
42
45
|
end
|
|
43
46
|
end
|
data/lib/lesli_shield/version.rb
CHANGED
data/readme.md
CHANGED
|
@@ -129,6 +129,15 @@ bin/rails lesli:db:prepare
|
|
|
129
129
|
bin/rails server
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
+
### User-role assignment integrity
|
|
133
|
+
|
|
134
|
+
The original migration `0801110110` requires a user and role for every assignment and adds a
|
|
135
|
+
unique index for active `(user_id, role_id)` pairs. Soft-deleted assignments remain
|
|
136
|
+
as history, and the same role can be assigned again after removal.
|
|
137
|
+
|
|
138
|
+
This pre-production schema change applies when creating the table from migrations.
|
|
139
|
+
Existing development databases must be rebuilt to pick up the constraints.
|
|
140
|
+
|
|
132
141
|
### Tests
|
|
133
142
|
|
|
134
143
|
From a complete Lesli development workspace, run the engine test suite from the LesliShield directory:
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lesli_shield
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.13
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- The Lesli Development Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-12-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lesli
|