@tomei/sso 0.46.8 → 0.46.10

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.
@@ -1,4 +1,6 @@
1
1
  import { ObjectBase } from '@tomei/general';
2
+ import { User as UserClass } from '../login-user/user';
3
+ import { User as UserLogin } from '../login-user/user';
2
4
  export declare class UserPrivilege extends ObjectBase {
3
5
  TableName: string;
4
6
  ObjectType: string;
@@ -17,6 +19,46 @@ export declare class UserPrivilege extends ObjectBase {
17
19
  get CreatedAt(): Date;
18
20
  get UpdatedAt(): Date;
19
21
  private static _Repository;
22
+ private static _UserGroupRepository;
23
+ private static _GroupPrivilegeRepository;
24
+ private static _SystemPrivilegeRepository;
20
25
  private constructor();
21
26
  static init(dbTransaction?: any, UserPrivilegeId?: number): Promise<UserPrivilege>;
27
+ static findAll(loginUser: UserClass, dbTransaction: any, whereOption: {
28
+ UserId: number;
29
+ SystemCode?: string;
30
+ }, pagination: {
31
+ page: number;
32
+ limit: number;
33
+ }): Promise<{
34
+ records: {
35
+ UserPrivilegeId: number;
36
+ SystemPrivilegeId: string;
37
+ PrivilegeCode: string;
38
+ SystemName: string;
39
+ Status: string;
40
+ CreatedBy: string;
41
+ CreatedAt: Date;
42
+ UpdatedBy: string;
43
+ UpdatedAt: Date;
44
+ }[];
45
+ pagination: {
46
+ currentPage: number;
47
+ pageSize: number;
48
+ totalRecords: number;
49
+ };
50
+ }>;
51
+ static findAllInheritedPrivileges(UserId: number, loginUser: UserClass, dbTransaction: any): Promise<any[]>;
52
+ static assignPrivileges(loginUser: UserLogin, dbTransaction: any, UserId: string, SystemPrivilegeId: string, Status: string): Promise<UserPrivilege>;
53
+ update(loginUser: UserLogin, dbTransaction: any, Status: string): Promise<{
54
+ UserPrivilegeId: number;
55
+ UserId: number;
56
+ SystemPrivilegeId: string;
57
+ Status: string;
58
+ CreatedById: number;
59
+ CreatedAt: Date;
60
+ UpdatedById: number;
61
+ UpdatedAt: Date;
62
+ }>;
63
+ static remove(loginUser: UserLogin, dbTransaction: any, UserPrivilegeId: number): Promise<void>;
22
64
  }
@@ -12,6 +12,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.UserPrivilege = void 0;
13
13
  const general_1 = require("@tomei/general");
14
14
  const user_privilege_repository_1 = require("./user-privilege.repository");
15
+ const config_1 = require("@tomei/config");
16
+ const system_privilege_entity_1 = require("../../models/system-privilege.entity");
17
+ const system_entity_1 = require("../../models/system.entity");
18
+ const user_group_repository_1 = require("../user-group/user-group.repository");
19
+ const group_entity_1 = require("../../models/group.entity");
20
+ const user_entity_1 = require("../../models/user.entity");
21
+ const group_privilege_repository_1 = require("../group-privilege/group-privilege.repository");
22
+ const system_privilege_repository_1 = require("../system-privilege/system-privilege.repository");
23
+ const sequelize_1 = require("sequelize");
24
+ const activity_history_1 = require("@tomei/activity-history");
15
25
  class UserPrivilege extends general_1.ObjectBase {
16
26
  get CreatedById() {
17
27
  return this._CreatedById;
@@ -63,7 +73,333 @@ class UserPrivilege extends general_1.ObjectBase {
63
73
  }
64
74
  });
65
75
  }
76
+ static findAll(loginUser, dbTransaction, whereOption, pagination) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ try {
79
+ const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
80
+ const privilegeCode = 'USER_PRIVILEGE_LIST';
81
+ const isPrivileged = yield loginUser.checkPrivileges(systemCode, privilegeCode);
82
+ if (!isPrivileged) {
83
+ throw new general_1.ClassError('UserPrivilege', 'UserPrivilegeErrMsg01', 'You do not have permission to access this resource.');
84
+ }
85
+ const options = {
86
+ where: {
87
+ UserId: whereOption.UserId,
88
+ },
89
+ offset: (pagination.page - 1) * pagination.limit,
90
+ limit: pagination.limit,
91
+ transaction: dbTransaction,
92
+ include: [
93
+ {
94
+ model: system_privilege_entity_1.default,
95
+ attributes: ['PrivilegeCode'],
96
+ include: [
97
+ {
98
+ model: system_entity_1.default,
99
+ attributes: ['Name'],
100
+ },
101
+ ],
102
+ },
103
+ {
104
+ model: user_entity_1.default,
105
+ as: 'CreatedByUser',
106
+ attributes: ['FullName'],
107
+ },
108
+ {
109
+ model: user_entity_1.default,
110
+ as: 'UpdatedByUser',
111
+ attributes: ['FullName'],
112
+ },
113
+ ],
114
+ };
115
+ const { count, rows } = yield this._Repository.findAllWithPagination(options);
116
+ return {
117
+ records: rows.map((record) => {
118
+ return {
119
+ UserPrivilegeId: record.UserPrivilegeId,
120
+ SystemPrivilegeId: record.SystemPrivilegeId,
121
+ PrivilegeCode: record.Privilege.PrivilegeCode,
122
+ SystemName: record.Privilege.System.Name,
123
+ Status: record.Status,
124
+ CreatedBy: record.CreatedByUser.FullName,
125
+ CreatedAt: record.CreatedAt,
126
+ UpdatedBy: record.UpdatedByUser.FullName,
127
+ UpdatedAt: record.UpdatedAt,
128
+ };
129
+ }),
130
+ pagination: {
131
+ currentPage: pagination.page,
132
+ pageSize: pagination.limit,
133
+ totalRecords: count,
134
+ },
135
+ };
136
+ }
137
+ catch (error) {
138
+ throw error;
139
+ }
140
+ });
141
+ }
142
+ static findAllInheritedPrivileges(UserId, loginUser, dbTransaction) {
143
+ return __awaiter(this, void 0, void 0, function* () {
144
+ try {
145
+ const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
146
+ const privilegeCode = 'USER_PRIVILEGE_LIST';
147
+ const isPrivileged = yield loginUser.checkPrivileges(systemCode, privilegeCode);
148
+ if (!isPrivileged) {
149
+ throw new general_1.ClassError('UserPrivilege', 'UserPrivilegeErrMsg01', 'You do not have permission to access this resource.');
150
+ }
151
+ const userGroups = yield UserPrivilege._UserGroupRepository.findAll({
152
+ where: {
153
+ UserId,
154
+ },
155
+ include: [
156
+ {
157
+ model: group_entity_1.default,
158
+ attributes: ['GroupCode', 'Name', 'InheritParentPrivilegeYN'],
159
+ },
160
+ ],
161
+ transaction: dbTransaction,
162
+ });
163
+ const listOfGroups = userGroups.map((groups) => {
164
+ let inheritPrivilegeYN = groups.InheritGroupPrivilegeYN;
165
+ if (inheritPrivilegeYN !== 'Y') {
166
+ inheritPrivilegeYN = 'N';
167
+ }
168
+ return {
169
+ GroupCode: groups.GroupCode,
170
+ GroupName: groups.Group.Name,
171
+ InheritPrivilegeYN: inheritPrivilegeYN,
172
+ Status: groups.Status,
173
+ };
174
+ });
175
+ const userGroupPrivilege = [];
176
+ for (let i = 0; i < listOfGroups.length; i++) {
177
+ const group = yield listOfGroups[i];
178
+ const data = {
179
+ GroupCode: group.GroupCode,
180
+ GroupName: group.GroupName,
181
+ InheritPrivilegeYN: group.InheritPrivilegeYN,
182
+ systems: [],
183
+ };
184
+ if (group.InheritPrivilegeYN === 'Y') {
185
+ if (group.Status === 'Active') {
186
+ const options = {
187
+ where: {
188
+ GroupCode: group.GroupCode,
189
+ Status: 'Active',
190
+ },
191
+ transaction: dbTransaction,
192
+ include: [
193
+ {
194
+ model: system_privilege_entity_1.default,
195
+ attributes: ['PrivilegeCode'],
196
+ include: [
197
+ {
198
+ model: system_entity_1.default,
199
+ attributes: ['Name'],
200
+ },
201
+ ],
202
+ },
203
+ {
204
+ model: user_entity_1.default,
205
+ as: 'CreatedByUser',
206
+ attributes: ['FullName'],
207
+ },
208
+ {
209
+ model: user_entity_1.default,
210
+ as: 'UpdatedByUser',
211
+ attributes: ['FullName'],
212
+ },
213
+ ],
214
+ };
215
+ const systemPrivilege = yield this._GroupPrivilegeRepository.findAll(options);
216
+ const privilegeDetails = systemPrivilege.map((record) => {
217
+ return {
218
+ GroupPrivilegeId: record.GroupPrivilegeId,
219
+ SystemPrivilegeId: record.SystemPrivilegeId,
220
+ PrivilegeCode: record.Privilege.PrivilegeCode,
221
+ Status: record.Status,
222
+ CreatedBy: record.CreatedByUser.FullName,
223
+ CreatedAt: record.CreatedAt,
224
+ UpdatedBy: record.UpdatedByUser.FullName,
225
+ UpdatedAt: record.UpdatedAt,
226
+ };
227
+ });
228
+ data.systems = privilegeDetails;
229
+ }
230
+ }
231
+ userGroupPrivilege.push(data);
232
+ }
233
+ return userGroupPrivilege;
234
+ }
235
+ catch (error) {
236
+ throw error;
237
+ }
238
+ });
239
+ }
240
+ static assignPrivileges(loginUser, dbTransaction, UserId, SystemPrivilegeId, Status) {
241
+ var _a;
242
+ return __awaiter(this, void 0, void 0, function* () {
243
+ try {
244
+ const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
245
+ const privilegeCode = 'USER_PRIVILEGE_CREATE';
246
+ const isPrivileged = yield loginUser.checkPrivileges(systemCode, privilegeCode);
247
+ if (!isPrivileged) {
248
+ throw new general_1.ClassError('UserSystemPrivilege', 'UserSystemPrivilegeErrMsg01', 'You do not have permission to access this resource.');
249
+ }
250
+ const isExist = yield UserPrivilege._SystemPrivilegeRepository.findAll({
251
+ where: { SystemPrivilegeId: SystemPrivilegeId },
252
+ transaction: dbTransaction,
253
+ });
254
+ if ((isExist === null || isExist === void 0 ? void 0 : isExist.length) < 1) {
255
+ throw new general_1.ClassError('UserSystemPrivilege', 'UserSystemPrivilegeErrMsg02', "system privileges don't exist");
256
+ }
257
+ const isUserAlreadyAssign = yield UserPrivilege._Repository.findAll({
258
+ where: {
259
+ [sequelize_1.Op.and]: [
260
+ { UserId: UserId },
261
+ { SystemPrivilegeId: SystemPrivilegeId },
262
+ ],
263
+ },
264
+ transaction: dbTransaction,
265
+ });
266
+ if ((isUserAlreadyAssign === null || isUserAlreadyAssign === void 0 ? void 0 : isUserAlreadyAssign.length) > 0) {
267
+ throw new general_1.ClassError('UserSystemPrivilege', 'UserSystemPrivilegeErrMsg03', 'User already have access to this privilege');
268
+ }
269
+ const newUserPrivilege = new UserPrivilege();
270
+ newUserPrivilege.UserId = parseInt(UserId);
271
+ newUserPrivilege.SystemPrivilegeId = SystemPrivilegeId;
272
+ newUserPrivilege.Status = Status;
273
+ newUserPrivilege._CreatedById = loginUser.UserId;
274
+ newUserPrivilege._CreatedAt = new Date();
275
+ newUserPrivilege._UpdatedById = loginUser.UserId;
276
+ newUserPrivilege._UpdatedAt = new Date();
277
+ const payload = {
278
+ UserId: newUserPrivilege.UserId,
279
+ SystemPrivilegeId: newUserPrivilege.SystemPrivilegeId,
280
+ Status: newUserPrivilege.Status,
281
+ CreatedById: newUserPrivilege.CreatedById,
282
+ CreatedAt: newUserPrivilege.CreatedAt,
283
+ UpdatedById: newUserPrivilege.UpdatedById,
284
+ UpdatedAt: newUserPrivilege.UpdatedAt,
285
+ };
286
+ const userPrivilege = yield UserPrivilege._Repository.create(payload, {
287
+ transaction: dbTransaction,
288
+ });
289
+ const entityValueBefore = {};
290
+ const activity = new activity_history_1.Activity();
291
+ activity.ActivityId = activity.createId();
292
+ activity.Action = activity_history_1.ActionEnum.CREATE;
293
+ activity.Description = 'Create User Privilege';
294
+ activity.EntityType = 'UserPrivilege';
295
+ activity.EntityId = (_a = userPrivilege.UserPrivilegeId) === null || _a === void 0 ? void 0 : _a.toString();
296
+ activity.EntityValueBefore = JSON.stringify(entityValueBefore);
297
+ activity.EntityValueAfter = JSON.stringify(payload);
298
+ yield activity.create(loginUser.ObjectId, dbTransaction);
299
+ newUserPrivilege.UserPrivilegeId = userPrivilege.UserPrivilegeId;
300
+ return newUserPrivilege;
301
+ }
302
+ catch (error) {
303
+ throw error;
304
+ }
305
+ });
306
+ }
307
+ update(loginUser, dbTransaction, Status) {
308
+ return __awaiter(this, void 0, void 0, function* () {
309
+ try {
310
+ const entityValueBefore = {
311
+ UserPrivilegeId: this.UserPrivilegeId,
312
+ UserId: this.UserId,
313
+ SystemPrivilegeId: this.SystemPrivilegeId,
314
+ Status: this.Status,
315
+ CreatedById: this.CreatedById,
316
+ CreatedAt: this.CreatedAt,
317
+ UpdatedById: this.UpdatedById,
318
+ UpdatedAt: this.UpdatedAt,
319
+ };
320
+ yield UserPrivilege._Repository.update({
321
+ Status: Status,
322
+ UpdatedById: loginUser.UserId,
323
+ UpdatedAt: new Date(),
324
+ }, {
325
+ where: {
326
+ UserPrivilegeId: this.UserPrivilegeId,
327
+ },
328
+ transaction: dbTransaction,
329
+ });
330
+ const entityValueAfter = {
331
+ UserPrivilegeId: this.UserPrivilegeId,
332
+ UserId: this.UserId,
333
+ SystemPrivilegeId: this.SystemPrivilegeId,
334
+ Status: Status,
335
+ CreatedById: this.CreatedById,
336
+ CreatedAt: this.CreatedAt,
337
+ UpdatedById: loginUser.UserId,
338
+ UpdatedAt: new Date(),
339
+ };
340
+ const activity = new activity_history_1.Activity();
341
+ activity.ActivityId = activity.createId();
342
+ activity.Action = activity_history_1.ActionEnum.UPDATE;
343
+ activity.Description = 'Update User Privilege';
344
+ activity.EntityType = 'UserPrivilege';
345
+ activity.EntityId = this.SystemPrivilegeId + '';
346
+ activity.EntityValueBefore = JSON.stringify(entityValueBefore);
347
+ activity.EntityValueAfter = JSON.stringify(entityValueAfter);
348
+ yield activity.create(loginUser.ObjectId, dbTransaction);
349
+ return entityValueAfter;
350
+ }
351
+ catch (error) {
352
+ throw error;
353
+ }
354
+ });
355
+ }
356
+ static remove(loginUser, dbTransaction, UserPrivilegeId) {
357
+ return __awaiter(this, void 0, void 0, function* () {
358
+ try {
359
+ const systemCode = config_1.ApplicationConfig.getComponentConfigValue('system-code');
360
+ const privilegeCode = 'USER_PRIVILEGE_REMOVE';
361
+ const isPrivileged = yield loginUser.checkPrivileges(systemCode, privilegeCode);
362
+ if (!isPrivileged) {
363
+ throw new general_1.ClassError('UserSystemPrivilege', 'UserSystemPrivilegeErrMsg01', 'You do not have permission to access this resource.');
364
+ }
365
+ const userPrivilege = yield UserPrivilege._Repository.findOne({
366
+ where: {
367
+ UserPrivilegeId: UserPrivilegeId,
368
+ },
369
+ transaction: dbTransaction,
370
+ });
371
+ if (!userPrivilege) {
372
+ throw new general_1.ClassError('UserSystemPrivilege', 'UserSystemPrivilegeErrMsg01', 'User Privilege not Found');
373
+ }
374
+ yield UserPrivilege._Repository.delete(UserPrivilegeId, dbTransaction);
375
+ const entityValueBefore = {
376
+ UserId: userPrivilege.UserId,
377
+ SystemPrivilegeId: userPrivilege.SystemPrivilegeId,
378
+ Status: userPrivilege.Status,
379
+ CreatedById: userPrivilege.CreatedById,
380
+ CreatedAt: userPrivilege.CreatedAt,
381
+ UpdatedById: userPrivilege.UpdatedById,
382
+ UpdatedAt: userPrivilege.UpdatedAt,
383
+ };
384
+ const activity = new activity_history_1.Activity();
385
+ activity.ActivityId = activity.createId();
386
+ activity.Action = activity_history_1.ActionEnum.DELETE;
387
+ activity.Description = 'Delete User Privilege';
388
+ activity.EntityType = 'UserPrivilege';
389
+ activity.EntityId = UserPrivilegeId === null || UserPrivilegeId === void 0 ? void 0 : UserPrivilegeId.toString();
390
+ activity.EntityValueBefore = JSON.stringify(entityValueBefore);
391
+ activity.EntityValueAfter = JSON.stringify({});
392
+ yield activity.create(loginUser.ObjectId, dbTransaction);
393
+ }
394
+ catch (error) {
395
+ throw error;
396
+ }
397
+ });
398
+ }
66
399
  }
67
400
  exports.UserPrivilege = UserPrivilege;
68
401
  UserPrivilege._Repository = new user_privilege_repository_1.UserPrivilegeRepository();
402
+ UserPrivilege._UserGroupRepository = new user_group_repository_1.UserGroupRepository();
403
+ UserPrivilege._GroupPrivilegeRepository = new group_privilege_repository_1.GroupPrivilegeRepository();
404
+ UserPrivilege._SystemPrivilegeRepository = new system_privilege_repository_1.SystemPrivilegeRepository();
69
405
  //# sourceMappingURL=user-privilege.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"user-privilege.js","sourceRoot":"","sources":["../../../../src/components/user-privilege/user-privilege.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAwD;AAExD,2EAAsE;AAEtE,MAAa,aAAc,SAAQ,oBAAU;IAc3C,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UA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AAvCgB,yBAAW,GAAG,IAAI,mDAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"user-privilege.js","sourceRoot":"","sources":["../../../../src/components/user-privilege/user-privilege.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAwD;AAExD,2EAAsE;AAEtE,0CAAkD;AAClD,kFAAwE;AACxE,8DAAqD;AACrD,+EAA0E;AAC1E,4DAAmD;AACnD,0DAA4C;AAC5C,8FAAyF;AAEzF,iGAA4F;AAC5F,yCAA+B;AAC/B,8DAA+D;AAE/D,MAAa,aAAc,SAAQ,oBAAU;IAc3C,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAOD,YAAoB,iBAAsC;QACxD,KAAK,EAAE,CAAC;QAnCV,cAAS,GAAG,mBAAmB,CAAC;QAChC,eAAU,GAAG,eAAe,CAAC;QAmC3B,IAAI,iBAAiB,EAAE;YACrB,IAAI,CAAC,eAAe,GAAG,iBAAiB,CAAC,eAAe,CAAC;YACzD,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC;YACvC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,iBAAiB,CAAC;YAC7D,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC;YACvC,IAAI,CAAC,YAAY,GAAG,iBAAiB,CAAC,WAAW,CAAC;YAClD,IAAI,CAAC,YAAY,GAAG,iBAAiB,CAAC,WAAW,CAAC;YAClD,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC,SAAS,CAAC;YAC9C,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC,SAAS,CAAC;SAC/C;IACH,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,GAAG,IAAI,2BAAQ,EAAE,CAAC;gBAChC,QAAQ,CAAC,UAAU,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBAC1C,QAAQ,CAAC,MAAM,GAAG,6BAAU,CAAC,MAAM,CAAC;gBACpC,QAAQ,CAAC,WAAW,GAAG,uBAAuB,CAAC;gBAC/C,QAAQ,CAAC,UAAU,GAAG,eAAe,CAAC;gBACtC,QAAQ,CAAC,QAAQ,GAAG,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,QAAQ,EAAE,CAAC;gBAChD,QAAQ,CAAC,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;gBAC/D,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;gBAG/C,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;aAC1D;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,KAAK,CAAC;aACb;QACH,CAAC;KAAA;;AAjoBH,sCAkoBC;AApmBgB,yBAAW,GAAG,IAAI,mDAAuB,EAAE,CAAC;AAC5C,kCAAoB,GAAG,IAAI,2CAAmB,EAAE,CAAC;AACjD,uCAAyB,GAAG,IAAI,qDAAwB,EAAE,CAAC;AAC3D,wCAA0B,GAAG,IAAI,uDAAyB,EAAE,CAAC"}
@@ -2,4 +2,5 @@ import UserPrivilegeModel from '../../models/user-privilege.entity';
2
2
  import { RepositoryBase, IRepositoryBase } from '@tomei/general';
3
3
  export declare class UserPrivilegeRepository extends RepositoryBase<UserPrivilegeModel> implements IRepositoryBase<UserPrivilegeModel> {
4
4
  constructor();
5
+ delete(UserPrivilegeId: number, dbTransaction?: any): Promise<void>;
5
6
  }
@@ -1,4 +1,13 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.UserPrivilegeRepository = void 0;
4
13
  const user_privilege_entity_1 = require("../../models/user-privilege.entity");
@@ -7,6 +16,22 @@ class UserPrivilegeRepository extends general_1.RepositoryBase {
7
16
  constructor() {
8
17
  super(user_privilege_entity_1.default);
9
18
  }
19
+ delete(UserPrivilegeId, dbTransaction) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ try {
22
+ const options = {
23
+ where: {
24
+ UserPrivilegeId: UserPrivilegeId,
25
+ },
26
+ transaction: dbTransaction,
27
+ };
28
+ yield user_privilege_entity_1.default.destroy(options);
29
+ }
30
+ catch (error) {
31
+ throw new Error(`An Error occured when delete : ${error.message}`);
32
+ }
33
+ });
34
+ }
10
35
  }
11
36
  exports.UserPrivilegeRepository = UserPrivilegeRepository;
12
37
  //# sourceMappingURL=user-privilege.repository.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"user-privilege.repository.js","sourceRoot":"","sources":["../../../../src/components/user-privilege/user-privilege.repository.ts"],"names":[],"mappings":";;;AAAA,8EAAoE;AACpE,4CAAiE;AAEjE,MAAa,uBACX,SAAQ,wBAAkC;IAG1C;QACE,KAAK,CAAC,+BAAkB,CAAC,CAAC;IAC5B,CAAC;CACF;AAPD,0DAOC"}
1
+ {"version":3,"file":"user-privilege.repository.js","sourceRoot":"","sources":["../../../../src/components/user-privilege/user-privilege.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EAAoE;AACpE,4CAAiE;AAEjE,MAAa,uBACX,SAAQ,wBAAkC;IAG1C;QACE,KAAK,CAAC,+BAAkB,CAAC,CAAC;IAC5B,CAAC;IAEK,MAAM,CAAC,eAAuB,EAAE,aAAmB;;YACvD,IAAI;gBACF,MAAM,OAAO,GAAG;oBACd,KAAK,EAAE;wBACL,eAAe,EAAE,eAAe;qBACjC;oBACD,WAAW,EAAE,aAAa;iBAC3B,CAAC;gBACF,MAAM,+BAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;aAC3C;YAAC,OAAO,KAAK,EAAE;gBACd,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;aACpE;QACH,CAAC;KAAA;CACF;AArBD,0DAqBC"}