@senior-gestao-empresarial/angular-components 4.21.1 → 4.22.0

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.
@@ -6717,18 +6717,20 @@ var VerifyModulePermission = /** @class */ (function () {
6717
6717
  /**
6718
6718
  * Method to verify if user has permission on a specific module
6719
6719
  * @param module Module to verify the permission
6720
+ * @param requestPermission Indicative if must be call the primitive
6720
6721
  * @returns An boolean Observable
6721
6722
  */
6722
- VerifyModulePermission.prototype.hasPermission = function (module) {
6723
+ VerifyModulePermission.prototype.hasPermission = function (module, requestPermission) {
6723
6724
  var moduleSubject = VerifyModulePermission_1.subjectsPerModuleMap.get(module);
6724
- if (!moduleSubject) {
6725
+ if (!moduleSubject || requestPermission) {
6725
6726
  var newModuleSubject_1 = new ReplaySubject(1);
6726
6727
  VerifyModulePermission_1.subjectsPerModuleMap.set(module, newModuleSubject_1);
6727
6728
  this.verifyModulePermissionService
6728
- .queryModule({ modulo: module })
6729
+ .queryModule({ modulo: module, somenteAtivo: true })
6729
6730
  .pipe(take(1))
6730
6731
  .subscribe(function (response) {
6731
- var hasPermission = !!response.modulos.find(function (modulo) { return modulo.ativo && !modulo.empresa; });
6732
+ var _a;
6733
+ var hasPermission = ((_a = response === null || response === void 0 ? void 0 : response.modulos) === null || _a === void 0 ? void 0 : _a.length) > 0;
6732
6734
  newModuleSubject_1.next(hasPermission);
6733
6735
  }, function (err) {
6734
6736
  VerifyModulePermission_1.subjectsPerModuleMap.delete(module);