@chevre/domain 23.2.0-alpha.4 → 23.2.0-alpha.5
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.
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as mongoose from 'mongoose';
|
|
3
|
+
|
|
4
|
+
import { chevre } from '../../../../lib/index';
|
|
5
|
+
|
|
6
|
+
async function main() {
|
|
7
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
8
|
+
|
|
9
|
+
const roleRepo = await chevre.repository.Role.createInstance(mongoose.connection);
|
|
10
|
+
|
|
11
|
+
const roleNames = [
|
|
12
|
+
// chevre.factory.role.organizationRole.RoleName.InventoryManager,
|
|
13
|
+
// chevre.factory.role.organizationRole.RoleName.SellersOwner,
|
|
14
|
+
// chevre.factory.role.organizationRole.RoleName.SellersInventoryManager,
|
|
15
|
+
chevre.factory.role.organizationRole.RoleName.TicketClerk
|
|
16
|
+
];
|
|
17
|
+
const permissions = [
|
|
18
|
+
'admin.sellers.eventSeries.read'
|
|
19
|
+
];
|
|
20
|
+
for (const roleName of roleNames) {
|
|
21
|
+
for (const permission of permissions) {
|
|
22
|
+
const result = await roleRepo.addPermissionIfNotExists({
|
|
23
|
+
roleName: { $eq: roleName },
|
|
24
|
+
permission
|
|
25
|
+
});
|
|
26
|
+
console.log('permission added.', result, roleName);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// roleNames = [
|
|
31
|
+
// chevre.factory.role.organizationRole.RoleName.TicketClerk
|
|
32
|
+
// ];
|
|
33
|
+
// permissions = [
|
|
34
|
+
// 'admin.sellers.productOffers.read'
|
|
35
|
+
// ];
|
|
36
|
+
// for (const roleName of roleNames) {
|
|
37
|
+
// for (const permission of permissions) {
|
|
38
|
+
// const result = await roleRepo.addPermissionIfNotExists({
|
|
39
|
+
// roleName: { $eq: roleName },
|
|
40
|
+
// permission
|
|
41
|
+
// });
|
|
42
|
+
// console.log('permission added.', result, roleName);
|
|
43
|
+
// }
|
|
44
|
+
// }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
main()
|
|
48
|
+
.then()
|
|
49
|
+
.catch(console.error);
|
|
@@ -95,7 +95,7 @@ class CreativeWorkRepo {
|
|
|
95
95
|
// 多言語名称対応(2022-07-11~)
|
|
96
96
|
andConditions.push({
|
|
97
97
|
$or: [
|
|
98
|
-
{ name: { $exists: true, $regex: new RegExp(params.name) } },
|
|
98
|
+
// { name: { $exists: true, $regex: new RegExp(params.name) } }, // string型への互換性維持を廃止(2025-12-20~)
|
|
99
99
|
{ 'name.ja': { $exists: true, $regex: new RegExp(params.name) } },
|
|
100
100
|
{ 'name.en': { $exists: true, $regex: new RegExp(params.name) } }
|
|
101
101
|
]
|
|
@@ -67,15 +67,16 @@ const indexes = [
|
|
|
67
67
|
name: 'searchByProjectId-v20220721'
|
|
68
68
|
}
|
|
69
69
|
],
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
// string型への互換性維持を廃止(2025-12-20~
|
|
71
|
+
// [
|
|
72
|
+
// { name: 1, identifier: 1 },
|
|
73
|
+
// {
|
|
74
|
+
// name: 'searchByName2',
|
|
75
|
+
// partialFilterExpression: {
|
|
76
|
+
// name: { $exists: true }
|
|
77
|
+
// }
|
|
78
|
+
// }
|
|
79
|
+
// ],
|
|
79
80
|
[
|
|
80
81
|
{ 'name.ja': 1, identifier: 1 },
|
|
81
82
|
{
|
package/package.json
CHANGED