complexqa_frontend_core 1.13.5 → 1.13.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "complexqa_frontend_core",
3
- "version": "1.13.5",
3
+ "version": "1.13.7",
4
4
  "description": "core of web ",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  import { abstractService } from "./abstractService";
2
2
  import { MockUserService } from "./mock_data/MockUserService";
3
- import { is_array } from "../utils/utils.js";
3
+ import { in_array, is_array } from "../utils/utils.js";
4
4
  import { typeTeam } from "../types/family_elements/typeTeam.js";
5
5
 
6
6
  /**
@@ -351,6 +351,44 @@ export class UserService extends abstractService
351
351
  }
352
352
 
353
353
 
354
+ /**
355
+ *
356
+ * @version v.1.0 (25/04/2026)
357
+ * @param {string} role
358
+ */
359
+ static add_role(role)
360
+ {
361
+ if (!is_array(UserService.roles))
362
+ {
363
+ UserService.roles = [];
364
+ }
365
+
366
+ if (!UserService.has_role(role))
367
+ {
368
+ UserService.roles.push(role);
369
+ }
370
+ }
371
+
372
+
373
+ /**
374
+ *
375
+ * @version v.1.0 (25/04/2026)
376
+ * @param role
377
+ * @returns {boolean}
378
+ */
379
+ static has_role(role)
380
+ {
381
+ if (in_array(role,UserService.roles))
382
+ {
383
+ return true;
384
+ }
385
+ else
386
+ {
387
+ return false;
388
+ }
389
+ }
390
+
391
+
354
392
  /**
355
393
  *
356
394
  * @version v.1.1 (27/07/2025)