@intelact/bright 0.9.178 → 0.9.180
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.
- package/lib/author/author.model.d.ts +1 -1
- package/lib/author/author.model.js +4 -4
- package/lib/boost/boost.model.d.ts +1 -1
- package/lib/boost/boost.model.js +16 -16
- package/lib/brand/brand.model.d.ts +1 -1
- package/lib/brand/brand.model.js +4 -4
- package/lib/category/category.model.d.ts +1 -1
- package/lib/category/category.model.js +4 -4
- package/lib/collection/collection.model.d.ts +1 -1
- package/lib/collection/collection.model.js +4 -4
- package/lib/feedback/feedback-item.model.d.ts +1 -1
- package/lib/feedback/feedback-item.model.js +8 -8
- package/lib/feedback/feedback.model.d.ts +1 -1
- package/lib/feedback/feedback.model.js +6 -6
- package/lib/post/post.model.d.ts +1 -1
- package/lib/post/post.model.js +48 -48
- package/lib/promotion/promotion.model.d.ts +1 -1
- package/lib/promotion/promotion.model.js +17 -17
- package/lib/publisher/publisher.model.d.ts +1 -1
- package/lib/publisher/publisher.model.js +19 -19
- package/lib/question/comment.model.d.ts +1 -1
- package/lib/question/comment.model.js +8 -8
- package/lib/question/comment.model.js.map +1 -1
- package/lib/question/question.model.d.ts +1 -3
- package/lib/question/question.model.js +6 -12
- package/lib/question/question.model.js.map +1 -1
- package/lib/quote/quote.model.d.ts +1 -1
- package/lib/quote/quote.model.js +4 -4
- package/lib/survey/survey.model.d.ts +1 -1
- package/lib/survey/survey.model.js +18 -18
- package/lib/topic/topic.model.d.ts +1 -1
- package/lib/topic/topic.model.js +4 -4
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/user/user.model.d.ts +1 -1
- package/lib/user/user.model.js +18 -17
- package/lib/user/user.model.js.map +1 -1
- package/package.json +1 -1
@@ -31,7 +31,7 @@ class Author {
|
|
31
31
|
createdOn;
|
32
32
|
updatedBy;
|
33
33
|
updatedOn;
|
34
|
-
|
34
|
+
authorization = {
|
35
35
|
manage: false,
|
36
36
|
merge: false,
|
37
37
|
};
|
@@ -59,8 +59,8 @@ class Author {
|
|
59
59
|
return data ? (0, class_transformer_1.plainToInstance)(Author, data, { groups: groups || [] }) : [];
|
60
60
|
}
|
61
61
|
authorize(user) {
|
62
|
-
this.
|
63
|
-
this.
|
62
|
+
this.authorization.manage = user?.hasPermission(security_1.Permission.AuthorManage);
|
63
|
+
this.authorization.merge = user?.hasPermission(security_1.Permission.AuthorMerge);
|
64
64
|
}
|
65
65
|
}
|
66
66
|
exports.Author = Author;
|
@@ -123,7 +123,7 @@ __decorate([
|
|
123
123
|
__decorate([
|
124
124
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
125
125
|
__metadata("design:type", Object)
|
126
|
-
], Author.prototype, "
|
126
|
+
], Author.prototype, "authorization", void 0);
|
127
127
|
__decorate([
|
128
128
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
129
129
|
__metadata("design:type", Function),
|
package/lib/boost/boost.model.js
CHANGED
@@ -35,7 +35,7 @@ let Boost = Boost_1 = class Boost {
|
|
35
35
|
createdOn;
|
36
36
|
updatedBy;
|
37
37
|
updatedOn;
|
38
|
-
|
38
|
+
authorization = {
|
39
39
|
edit: false,
|
40
40
|
publish: false,
|
41
41
|
unpublish: false,
|
@@ -66,11 +66,11 @@ let Boost = Boost_1 = class Boost {
|
|
66
66
|
return this?.metrics?.find(i => i.event === user_1.UserEvent.Download);
|
67
67
|
}
|
68
68
|
authorize(user) {
|
69
|
-
this.
|
70
|
-
this.
|
71
|
-
this.
|
72
|
-
this.
|
73
|
-
this.
|
69
|
+
this.authorization.edit = false;
|
70
|
+
this.authorization.delete = false;
|
71
|
+
this.authorization.publish = false;
|
72
|
+
this.authorization.unpublish = false;
|
73
|
+
this.authorization.end = false;
|
74
74
|
this.setLabel();
|
75
75
|
if (!user?.isBrandUser()) {
|
76
76
|
return;
|
@@ -84,15 +84,15 @@ let Boost = Boost_1 = class Boost {
|
|
84
84
|
const isPublished = this.status === common_1.StatusType.Published;
|
85
85
|
const isLive = this.label === common_1.StatusLabel.Live;
|
86
86
|
if (isDraft) {
|
87
|
-
this.
|
88
|
-
this.
|
89
|
-
this.
|
87
|
+
this.authorization.edit = !isEnded && canManage;
|
88
|
+
this.authorization.delete = !isEnded && canManage;
|
89
|
+
this.authorization.publish = !isExpired && !isEnded && canPublish;
|
90
90
|
}
|
91
91
|
if (isPublished && isUpcoming) {
|
92
|
-
this.
|
92
|
+
this.authorization.unpublish = canPublish;
|
93
93
|
}
|
94
94
|
if (isPublished && isLive) {
|
95
|
-
this.
|
95
|
+
this.authorization.end = canPublish;
|
96
96
|
}
|
97
97
|
}
|
98
98
|
setValidators() {
|
@@ -121,7 +121,7 @@ let Boost = Boost_1 = class Boost {
|
|
121
121
|
if (!this.validators) {
|
122
122
|
this.setValidators();
|
123
123
|
}
|
124
|
-
this.
|
124
|
+
this.authorization.isValid = true;
|
125
125
|
this.validators = this.validators.map(i => {
|
126
126
|
i.value = true;
|
127
127
|
return i;
|
@@ -130,17 +130,17 @@ let Boost = Boost_1 = class Boost {
|
|
130
130
|
if (!this.title || this.title.trim().length === 0) {
|
131
131
|
validator = this.validators?.find(i => i.name === 'title');
|
132
132
|
validator.value = false;
|
133
|
-
this.
|
133
|
+
this.authorization.isValid = false;
|
134
134
|
}
|
135
135
|
if (!this.startDate || !this.endDate) {
|
136
136
|
validator = this.validators?.find(i => i.name === 'period');
|
137
137
|
validator.value = false;
|
138
|
-
this.
|
138
|
+
this.authorization.isValid = false;
|
139
139
|
}
|
140
140
|
if (!this.items || this.items.length === 0) {
|
141
141
|
validator = this.validators?.find(i => i.name === 'items');
|
142
142
|
validator.value = false;
|
143
|
-
this.
|
143
|
+
this.authorization.isValid = false;
|
144
144
|
}
|
145
145
|
}
|
146
146
|
setLabel() {
|
@@ -240,7 +240,7 @@ __decorate([
|
|
240
240
|
__decorate([
|
241
241
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
242
242
|
__metadata("design:type", Object)
|
243
|
-
], Boost.prototype, "
|
243
|
+
], Boost.prototype, "authorization", void 0);
|
244
244
|
__decorate([
|
245
245
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
246
246
|
(0, class_transformer_1.Type)(() => item_1.Item),
|
package/lib/brand/brand.model.js
CHANGED
@@ -41,7 +41,7 @@ class Brand {
|
|
41
41
|
contactEmail;
|
42
42
|
settings;
|
43
43
|
publishers;
|
44
|
-
|
44
|
+
authorization = {
|
45
45
|
manage: false
|
46
46
|
};
|
47
47
|
constructor(props) {
|
@@ -140,11 +140,11 @@ class Brand {
|
|
140
140
|
return data ? (0, class_transformer_1.plainToInstance)(Brand, data, { groups: groups || [] }) : [];
|
141
141
|
}
|
142
142
|
authorize(user) {
|
143
|
-
this.
|
143
|
+
this.authorization.manage = false;
|
144
144
|
if (!user.isBrandUser()) {
|
145
145
|
return;
|
146
146
|
}
|
147
|
-
this.
|
147
|
+
this.authorization.manage = user?.hasPermission(security_1.Permission.BrandAccountManage);
|
148
148
|
}
|
149
149
|
}
|
150
150
|
exports.Brand = Brand;
|
@@ -246,7 +246,7 @@ __decorate([
|
|
246
246
|
__decorate([
|
247
247
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
248
248
|
__metadata("design:type", Object)
|
249
|
-
], Brand.prototype, "
|
249
|
+
], Brand.prototype, "authorization", void 0);
|
250
250
|
__decorate([
|
251
251
|
(0, class_transformer_1.Expose)(),
|
252
252
|
__metadata("design:type", Function),
|
@@ -28,7 +28,7 @@ class Category {
|
|
28
28
|
createdOn;
|
29
29
|
updatedBy;
|
30
30
|
updatedOn;
|
31
|
-
|
31
|
+
authorization = {
|
32
32
|
manage: false
|
33
33
|
};
|
34
34
|
constructor(props) {
|
@@ -67,11 +67,11 @@ class Category {
|
|
67
67
|
return data ? (0, class_transformer_1.plainToInstance)(Category, data, { groups: groups || [] }) : [];
|
68
68
|
}
|
69
69
|
authorize(user) {
|
70
|
-
this.
|
70
|
+
this.authorization.manage = false;
|
71
71
|
if (!user?.isBrandUser()) {
|
72
72
|
return;
|
73
73
|
}
|
74
|
-
this.
|
74
|
+
this.authorization.manage = user?.hasPermission(security_1.Permission.CategoryManage);
|
75
75
|
}
|
76
76
|
}
|
77
77
|
exports.Category = Category;
|
@@ -125,7 +125,7 @@ __decorate([
|
|
125
125
|
__decorate([
|
126
126
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
127
127
|
__metadata("design:type", Object)
|
128
|
-
], Category.prototype, "
|
128
|
+
], Category.prototype, "authorization", void 0);
|
129
129
|
__decorate([
|
130
130
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
131
131
|
__metadata("design:type", Function),
|
@@ -27,7 +27,7 @@ class Collection {
|
|
27
27
|
createdOn;
|
28
28
|
updatedBy;
|
29
29
|
updatedOn;
|
30
|
-
|
30
|
+
authorization = {
|
31
31
|
manage: false
|
32
32
|
};
|
33
33
|
publisher;
|
@@ -59,11 +59,11 @@ class Collection {
|
|
59
59
|
return data ? (0, class_transformer_1.plainToInstance)(Collection, data, { groups: groups || [] }) : [];
|
60
60
|
}
|
61
61
|
authorize(user, publisher) {
|
62
|
-
this.
|
62
|
+
this.authorization.manage = false;
|
63
63
|
if (!user.isPublisherUser() || publisher.status !== security_1.AccountStatus.Active) {
|
64
64
|
return;
|
65
65
|
}
|
66
|
-
this.
|
66
|
+
this.authorization.manage = user?.hasPermission(security_1.Permission.CollectionManage);
|
67
67
|
}
|
68
68
|
}
|
69
69
|
exports.Collection = Collection;
|
@@ -109,7 +109,7 @@ __decorate([
|
|
109
109
|
__decorate([
|
110
110
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
111
111
|
__metadata("design:type", Object)
|
112
|
-
], Collection.prototype, "
|
112
|
+
], Collection.prototype, "authorization", void 0);
|
113
113
|
__decorate([
|
114
114
|
(0, class_transformer_1.Expose)(),
|
115
115
|
(0, class_transformer_1.Type)(() => publisher_model_1.Publisher),
|
@@ -25,7 +25,7 @@ class FeedbackItem {
|
|
25
25
|
createdOn;
|
26
26
|
updatedBy;
|
27
27
|
updatedOn;
|
28
|
-
|
28
|
+
authorization = {
|
29
29
|
manage: false,
|
30
30
|
publish: false,
|
31
31
|
archive: false,
|
@@ -41,17 +41,17 @@ class FeedbackItem {
|
|
41
41
|
return data ? (0, class_transformer_1.plainToInstance)(FeedbackItem, data, { groups: groups || [] }) : [];
|
42
42
|
}
|
43
43
|
authorize(user) {
|
44
|
-
this.
|
45
|
-
this.
|
46
|
-
this.
|
44
|
+
this.authorization.manage = false;
|
45
|
+
this.authorization.publish = false;
|
46
|
+
this.authorization.archive = false;
|
47
47
|
if (!user?.isBrandUser()) {
|
48
48
|
return;
|
49
49
|
}
|
50
50
|
const canManage = user?.hasPermission(security_1.Permission.FeedbackManage);
|
51
51
|
const canPublish = user?.hasPermission(security_1.Permission.FeedbackPublish);
|
52
|
-
this.
|
53
|
-
this.
|
54
|
-
this.
|
52
|
+
this.authorization.manage = canManage && !this.published;
|
53
|
+
this.authorization.publish = canPublish && !this.published;
|
54
|
+
this.authorization.archive = canPublish && this.published;
|
55
55
|
}
|
56
56
|
validate() {
|
57
57
|
const content = this?.question?.trim();
|
@@ -122,7 +122,7 @@ __decorate([
|
|
122
122
|
__decorate([
|
123
123
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
124
124
|
__metadata("design:type", Object)
|
125
|
-
], FeedbackItem.prototype, "
|
125
|
+
], FeedbackItem.prototype, "authorization", void 0);
|
126
126
|
__decorate([
|
127
127
|
(0, class_transformer_1.Expose)(),
|
128
128
|
(0, class_transformer_1.Type)(() => feedback_option_model_1.FeedbackOption),
|
@@ -31,7 +31,7 @@ class Feedback {
|
|
31
31
|
createdOn;
|
32
32
|
updatedBy;
|
33
33
|
updatedOn;
|
34
|
-
|
34
|
+
authorization = {
|
35
35
|
manage: false,
|
36
36
|
publish: false,
|
37
37
|
};
|
@@ -66,13 +66,13 @@ class Feedback {
|
|
66
66
|
return data ? (0, class_transformer_1.plainToInstance)(Feedback, data, { groups: groups || [] }) : [];
|
67
67
|
}
|
68
68
|
authorize(user) {
|
69
|
-
this.
|
70
|
-
this.
|
69
|
+
this.authorization.manage = false;
|
70
|
+
this.authorization.publish = false;
|
71
71
|
if (!user?.isBrandUser()) {
|
72
72
|
return;
|
73
73
|
}
|
74
|
-
this.
|
75
|
-
this.
|
74
|
+
this.authorization.manage = user?.hasPermission(security_1.Permission.FeedbackManage);
|
75
|
+
this.authorization.publish = user?.hasPermission(security_1.Permission.FeedbackPublish);
|
76
76
|
if (this.items?.length) {
|
77
77
|
for (const item of this.items) {
|
78
78
|
item.authorize(user);
|
@@ -131,7 +131,7 @@ __decorate([
|
|
131
131
|
__decorate([
|
132
132
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
133
133
|
__metadata("design:type", Object)
|
134
|
-
], Feedback.prototype, "
|
134
|
+
], Feedback.prototype, "authorization", void 0);
|
135
135
|
__decorate([
|
136
136
|
(0, class_transformer_1.Expose)(),
|
137
137
|
(0, class_transformer_1.Type)(() => feedback_item_model_1.FeedbackItem),
|
package/lib/post/post.model.d.ts
CHANGED
@@ -68,7 +68,7 @@ export declare class Post {
|
|
68
68
|
feedback: Feedback;
|
69
69
|
collection: Post[];
|
70
70
|
gallery: GalleryItem[];
|
71
|
-
|
71
|
+
authorization: IPostAuthorization;
|
72
72
|
validators: Item<boolean>[];
|
73
73
|
constructor(props?: Partial<Post>);
|
74
74
|
get type(): PostType;
|
package/lib/post/post.model.js
CHANGED
@@ -61,7 +61,7 @@ class Post {
|
|
61
61
|
feedback;
|
62
62
|
collection;
|
63
63
|
gallery;
|
64
|
-
|
64
|
+
authorization = {
|
65
65
|
view: false,
|
66
66
|
create: false,
|
67
67
|
edit: false,
|
@@ -169,9 +169,9 @@ class Post {
|
|
169
169
|
}
|
170
170
|
}
|
171
171
|
validateForPublic() {
|
172
|
-
this.
|
173
|
-
this.
|
174
|
-
this.
|
172
|
+
this.authorization.canLike = true;
|
173
|
+
this.authorization.canShare = true;
|
174
|
+
this.authorization.canBookmark = [
|
175
175
|
post_type_1.PostType.Article,
|
176
176
|
post_type_1.PostType.Book,
|
177
177
|
post_type_1.PostType.Audio,
|
@@ -179,28 +179,28 @@ class Post {
|
|
179
179
|
post_type_1.PostType.News,
|
180
180
|
post_type_1.PostType.Event,
|
181
181
|
].includes(this.type) ? true : false;
|
182
|
-
this.
|
182
|
+
this.authorization.canDownload = [
|
183
183
|
post_type_1.PostType.Article,
|
184
184
|
post_type_1.PostType.Book,
|
185
185
|
].includes(this.type) ? true : false;
|
186
|
-
this.
|
186
|
+
this.authorization.showGallery = [
|
187
187
|
post_type_1.PostType.Event,
|
188
188
|
post_type_1.PostType.News,
|
189
189
|
].includes(this.type) ? true : false;
|
190
190
|
}
|
191
191
|
authorize(user, publisher) {
|
192
|
-
this.
|
193
|
-
this.
|
194
|
-
this.
|
195
|
-
this.
|
196
|
-
this.
|
197
|
-
this.
|
198
|
-
this.
|
199
|
-
this.
|
200
|
-
this.
|
201
|
-
this.
|
202
|
-
this.
|
203
|
-
this.
|
192
|
+
this.authorization.view = false;
|
193
|
+
this.authorization.create = false;
|
194
|
+
this.authorization.edit = false;
|
195
|
+
this.authorization.delete = false;
|
196
|
+
this.authorization.draft = false;
|
197
|
+
this.authorization.approve = false;
|
198
|
+
this.authorization.publish = false;
|
199
|
+
this.authorization.unpublish = false;
|
200
|
+
this.authorization.archive = false;
|
201
|
+
this.authorization.unarchive = false;
|
202
|
+
this.authorization.block = false;
|
203
|
+
this.authorization.unblock = false;
|
204
204
|
const isDraft = this.status === status_type_1.StatusType.Draft;
|
205
205
|
const isApproved = this.status === status_type_1.StatusType.Ready;
|
206
206
|
const isPublished = this.status === status_type_1.StatusType.Published;
|
@@ -235,14 +235,14 @@ class Post {
|
|
235
235
|
break;
|
236
236
|
}
|
237
237
|
if (isBlocked) {
|
238
|
-
this.
|
239
|
-
this.
|
238
|
+
this.authorization.block = false;
|
239
|
+
this.authorization.unblock = canBlock;
|
240
240
|
}
|
241
241
|
else {
|
242
|
-
this.
|
243
|
-
this.
|
242
|
+
this.authorization.block = canBlock;
|
243
|
+
this.authorization.unblock = false;
|
244
244
|
}
|
245
|
-
this.
|
245
|
+
this.authorization.view = canView;
|
246
246
|
return;
|
247
247
|
}
|
248
248
|
if (user.hasPublisherAuthorization(publisher.id)) {
|
@@ -284,28 +284,28 @@ class Post {
|
|
284
284
|
canArchive = user?.hasPermission(security_1.Permission.PostNewsArchive);
|
285
285
|
break;
|
286
286
|
}
|
287
|
-
this.
|
287
|
+
this.authorization.view = canView;
|
288
288
|
if (publisher.status !== security_1.AccountStatus.Active) {
|
289
289
|
return;
|
290
290
|
}
|
291
|
-
this.
|
291
|
+
this.authorization.create = canEdit && publisher.hasAuthorizedType(this.postType);
|
292
292
|
if (isDraft) {
|
293
|
-
this.
|
294
|
-
this.
|
295
|
-
this.
|
296
|
-
this.
|
293
|
+
this.authorization.edit = canEdit;
|
294
|
+
this.authorization.delete = canEdit;
|
295
|
+
this.authorization.approve = canEdit;
|
296
|
+
this.authorization.archive = canArchive;
|
297
297
|
}
|
298
298
|
if (isApproved) {
|
299
|
-
this.
|
300
|
-
this.
|
301
|
-
this.
|
299
|
+
this.authorization.draft = canEdit;
|
300
|
+
this.authorization.publish = canPublish;
|
301
|
+
this.authorization.archive = canArchive;
|
302
302
|
}
|
303
303
|
if (isPublished) {
|
304
|
-
this.
|
305
|
-
this.
|
304
|
+
this.authorization.unpublish = canPublish;
|
305
|
+
this.authorization.archive = canArchive;
|
306
306
|
}
|
307
307
|
if (isArchived) {
|
308
|
-
this.
|
308
|
+
this.authorization.unarchive = canArchive;
|
309
309
|
}
|
310
310
|
}
|
311
311
|
}
|
@@ -313,8 +313,8 @@ class Post {
|
|
313
313
|
if (!this.validators) {
|
314
314
|
this.setValidators();
|
315
315
|
}
|
316
|
-
this.
|
317
|
-
this.
|
316
|
+
this.authorization.isValid = true;
|
317
|
+
this.authorization.showGallery = [
|
318
318
|
post_type_1.PostType.Event,
|
319
319
|
post_type_1.PostType.News,
|
320
320
|
].includes(this.type) ? true : false;
|
@@ -327,53 +327,53 @@ class Post {
|
|
327
327
|
if (!this.author) {
|
328
328
|
validator = this.validators?.find(i => i.name === 'author');
|
329
329
|
validator.value = false;
|
330
|
-
this.
|
330
|
+
this.authorization.isValid = false;
|
331
331
|
}
|
332
332
|
if (!this.title || !this.title.trim()) {
|
333
333
|
validator = this.validators?.find(i => i.name === 'title');
|
334
334
|
validator.value = false;
|
335
|
-
this.
|
335
|
+
this.authorization.isValid = false;
|
336
336
|
}
|
337
337
|
if (!this.description || !this.description.trim()) {
|
338
338
|
validator = this.validators?.find(i => i.name === 'description');
|
339
339
|
validator.value = false;
|
340
|
-
this.
|
340
|
+
this.authorization.isValid = false;
|
341
341
|
}
|
342
342
|
if (!this.imageUrl || !this.imageUrl.trim()) {
|
343
343
|
validator = this.validators?.find(i => i.name === 'image');
|
344
344
|
validator.value = false;
|
345
|
-
this.
|
345
|
+
this.authorization.isValid = false;
|
346
346
|
}
|
347
347
|
if (!this.feedUrl || !this.feedUrl.trim()) {
|
348
348
|
validator = this.validators?.find(i => i.name === 'feed');
|
349
349
|
validator.value = false;
|
350
|
-
this.
|
350
|
+
this.authorization.isValid = false;
|
351
351
|
}
|
352
352
|
if (contentMandatory.includes(this.type) && !this.content?.trim()) {
|
353
353
|
validator = this.validators?.find(i => i.name === 'content');
|
354
354
|
validator.value = false;
|
355
|
-
this.
|
355
|
+
this.authorization.isValid = false;
|
356
356
|
}
|
357
357
|
if (this.type === post_type_1.PostType.Book && !this.pdfUrl?.trim()) {
|
358
358
|
validator = this.validators?.find(i => i.name === 'pdf');
|
359
359
|
validator.value = false;
|
360
|
-
this.
|
360
|
+
this.authorization.isValid = false;
|
361
361
|
}
|
362
362
|
if (this.type === post_type_1.PostType.Audio && !this.mediaUrl?.trim()) {
|
363
363
|
validator = this.validators?.find(i => i.name === 'audio');
|
364
364
|
validator.value = false;
|
365
|
-
this.
|
365
|
+
this.authorization.isValid = false;
|
366
366
|
}
|
367
367
|
if (this.type === post_type_1.PostType.Video && !this.mediaUrl?.trim()) {
|
368
368
|
validator = this.validators?.find(i => i.name === 'video');
|
369
369
|
validator.value = false;
|
370
|
-
this.
|
370
|
+
this.authorization.isValid = false;
|
371
371
|
}
|
372
372
|
if (this.type === post_type_1.PostType.Event
|
373
373
|
&& (!this?.info?.events || this?.info?.events?.length === 0)) {
|
374
374
|
validator = this.validators?.find(i => i.name === 'schedule');
|
375
375
|
validator.value = false;
|
376
|
-
this.
|
376
|
+
this.authorization.isValid = false;
|
377
377
|
}
|
378
378
|
}
|
379
379
|
get statusContext() {
|
@@ -631,7 +631,7 @@ __decorate([
|
|
631
631
|
__decorate([
|
632
632
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
633
633
|
__metadata("design:type", Object)
|
634
|
-
], Post.prototype, "
|
634
|
+
], Post.prototype, "authorization", void 0);
|
635
635
|
__decorate([
|
636
636
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
637
637
|
(0, class_transformer_1.Type)(() => item_model_1.Item),
|