@tomei/sso 0.46.9 → 0.46.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
1
  import { ObjectBase } from '@tomei/general';
2
2
  import { User as UserClass } from '../login-user/user';
3
+ import { User as UserLogin } from '../login-user/user';
3
4
  export declare class UserPrivilege extends ObjectBase {
4
5
  TableName: string;
5
6
  ObjectType: string;
@@ -20,6 +21,7 @@ export declare class UserPrivilege extends ObjectBase {
20
21
  private static _Repository;
21
22
  private static _UserGroupRepository;
22
23
  private static _GroupPrivilegeRepository;
24
+ private static _SystemPrivilegeRepository;
23
25
  private constructor();
24
26
  static init(dbTransaction?: any, UserPrivilegeId?: number): Promise<UserPrivilege>;
25
27
  static findAll(loginUser: UserClass, dbTransaction: any, whereOption: {
@@ -47,4 +49,16 @@ export declare class UserPrivilege extends ObjectBase {
47
49
  };
48
50
  }>;
49
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>;
50
64
  }
@@ -19,6 +19,9 @@ const user_group_repository_1 = require("../user-group/user-group.repository");
19
19
  const group_entity_1 = require("../../models/group.entity");
20
20
  const user_entity_1 = require("../../models/user.entity");
21
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");
22
25
  class UserPrivilege extends general_1.ObjectBase {
23
26
  get CreatedById() {
24
27
  return this._CreatedById;
@@ -234,9 +237,169 @@ class UserPrivilege extends general_1.ObjectBase {
234
237
  }
235
238
  });
236
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
+ }
237
399
  }
238
400
  exports.UserPrivilege = UserPrivilege;
239
401
  UserPrivilege._Repository = new user_privilege_repository_1.UserPrivilegeRepository();
240
402
  UserPrivilege._UserGroupRepository = new user_group_repository_1.UserGroupRepository();
241
403
  UserPrivilege._GroupPrivilegeRepository = new group_privilege_repository_1.GroupPrivilegeRepository();
404
+ UserPrivilege._SystemPrivilegeRepository = new system_privilege_repository_1.SystemPrivilegeRepository();
242
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,0CAAkD;AAClD,kFAAwE;AACxE,8DAAqD;AACrD,+EAA0E;AAC1E,4DAAmD;AACnD,0DAA4C;AAC5C,8FAAyF;AAEzF,MAAa,aAAc,SAAQ,oBAAU;IAc3C,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAA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H,CAAC;KAAA;;AArUH,sCAsUC;AAxSgB,yBAAW,GAAG,IAAI,mDAAuB,EAAE,CAAC;AAC5C,kCAAoB,GAAG,IAAI,2CAAmB,EAAE,CAAC;AACjD,uCAAyB,GAAG,IAAI,qDAAwB,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;Y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AAa,CAAC,SAAS;oBAClC,WAAW,EAAE,aAAa,CAAC,WAAW;oBACtC,SAAS,EAAE,aAAa,CAAC,SAAS;iBACnC,CAAC;gBAgBF,MAAM,QAAQ,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"}