ngx-sp-auth 4.1.1 → 4.1.2

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.
@@ -0,0 +1,11 @@
1
+ import { Router } from '@angular/router';
2
+ import { AuthStorageService } from '../../storage/auth-storage.service';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ErrorMenuNotAllowed {
5
+ private router;
6
+ authStorageService: AuthStorageService;
7
+ constructor(router: Router, authStorageService: AuthStorageService);
8
+ onHome(): void;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<ErrorMenuNotAllowed, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<ErrorMenuNotAllowed, "app-menu-not-allowed", never, {}, {}, never, never, true, never>;
11
+ }
@@ -12,6 +12,7 @@ import { NavSubmenuSearchItem } from './model/navsubmenu-searchitem';
12
12
  import { RetDynamicMenu } from './model/dynamic-menu';
13
13
  import { RetDropDown } from './model/ret-dropdown';
14
14
  import { RetVersion } from './model/ret-version';
15
+ import { RetIsMenuAllowed } from './model/ret-is-menu-allowed';
15
16
  import * as i0 from "@angular/core";
16
17
  export declare class MenuServicesService {
17
18
  private _authStorageService;
@@ -28,6 +29,9 @@ export declare class MenuServicesService {
28
29
  getUsuarioEmail(): Observable<RetInfraUsuarioEmail>;
29
30
  getVersionInfra(): Observable<RetVersion>;
30
31
  getVersionCorporativo(): Observable<RetVersion>;
32
+ /** Método executado para validar a permissão de acesso a uma opção do menu
33
+ */
34
+ isMenuAllowed(route: string): Observable<RetIsMenuAllowed>;
31
35
  updateLastLogEstabID(estabID: string): Observable<RetError>;
32
36
  defineDefaultEstabelecimento(estabID: string, usuarioID: string, isDefault: boolean): Observable<RetError>;
33
37
  /** Método executado para pegar o Menu lateral levando em conta as permissões do usuário, grupo e o tenant ativo
@@ -0,0 +1,6 @@
1
+ import { IError } from "ngx-sp-infra";
2
+ export declare class RetIsMenuAllowed implements IError {
3
+ Error: boolean;
4
+ ErrorMessage: string;
5
+ IsMenuAllowed: boolean;
6
+ }
@@ -0,0 +1,16 @@
1
+ import { Router, UrlTree, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
2
+ import { Observable } from 'rxjs';
3
+ import { MenuServicesService } from '../components/menu-lateral/menu-services.service';
4
+ import * as i0 from "@angular/core";
5
+ export declare class IsMenuAllowedlGuard {
6
+ private router;
7
+ private _menuService;
8
+ constructor(router: Router, _menuService: MenuServicesService);
9
+ canActivate(_route: ActivatedRouteSnapshot, _state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
10
+ private navigateToError;
11
+ private isMenuAllowedGuard;
12
+ private handleIsMenuAllowed;
13
+ private IsMenuAllowed;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<IsMenuAllowedlGuard, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<IsMenuAllowedlGuard>;
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-sp-auth",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "description": "Biblioteca de utilitários de autenticação.",
5
5
  "author": "P&D",
6
6
  "keywords": [
package/public-api.d.ts CHANGED
@@ -19,6 +19,7 @@ export * from './lib/components/menu-lateral/menu/selecao-estabelecimentos-modal
19
19
  export * from './lib/components/menu-lateral/submenus/dynamic-menu/dynamic-menu.component';
20
20
  export * from './lib/components/menu-lateral/submenus/notif-submenu/notif-submenu.component';
21
21
  export * from './lib/components/nova-senha/nova-senhacomponent';
22
+ export * from './lib/components/error-menu-not-allowed/error-menu-not-allowed.component';
22
23
  /** Models */
23
24
  export * from './lib/components/menu-lateral/model/imenu-item-structure.model';
24
25
  export * from './lib/components/menu-lateral/model/imenu.model';
@@ -40,6 +41,7 @@ export * from './lib/guards/auth-guard';
40
41
  export * from './lib/guards/external-login-guard';
41
42
  export * from './lib/guards/login-guard';
42
43
  export * from './lib/guards/login-os.guard';
44
+ export * from './lib/guards/is-menu-allowed-guard';
43
45
  /** Interceptors */
44
46
  export * from './lib/interceptors/auth-aplic.interceptor';
45
47
  export * from './lib/interceptors/auth-infra.interceptor';