ngx-sp-auth 4.1.0 → 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.
- package/fesm2022/ngx-sp-auth.mjs +122 -17
- package/fesm2022/ngx-sp-auth.mjs.map +1 -1
- package/lib/components/error-menu-not-allowed/error-menu-not-allowed.component.d.ts +11 -0
- package/lib/components/menu-lateral/menu-services.service.d.ts +4 -0
- package/lib/components/menu-lateral/model/ret-is-menu-allowed.d.ts +6 -0
- package/lib/guards/is-menu-allowed-guard.d.ts +16 -0
- package/lib/widgets/sub-menu/nav-tabs/nav-tabs.component.d.ts +3 -1
- package/lib/widgets/sub-menu/sub-menu.component.d.ts +3 -6
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -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,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
|
+
}
|
|
@@ -4,10 +4,12 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class NavTabsComponent implements OnInit {
|
|
5
5
|
subMenus: SubMenuItem[];
|
|
6
6
|
hostName: string;
|
|
7
|
+
activeItem?: string;
|
|
7
8
|
telasItem: TelaItem[];
|
|
8
9
|
listaAtiva: string;
|
|
10
|
+
constructor();
|
|
9
11
|
ngOnInit(): void;
|
|
10
12
|
abaActive(b: string): void;
|
|
11
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<NavTabsComponent, never>;
|
|
12
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NavTabsComponent, "app-nav-tabs", never, { "subMenus": { "alias": "subMenus"; "required": false; }; "hostName": { "alias": "hostName"; "required": false; }; }, {}, never, never, true, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NavTabsComponent, "app-nav-tabs", never, { "subMenus": { "alias": "subMenus"; "required": false; }; "hostName": { "alias": "hostName"; "required": false; }; "activeItem": { "alias": "activeItem"; "required": false; }; }, {}, never, never, true, never>;
|
|
13
15
|
}
|
|
@@ -19,19 +19,16 @@ export declare class TelaItem {
|
|
|
19
19
|
export declare class SubMenuComponent implements OnInit {
|
|
20
20
|
private _menuService;
|
|
21
21
|
private _projectUtil;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
constructor(_menuService: MenuServicesService, _projectUtil: ProjectUtilservice);
|
|
26
22
|
navSubmenus: NavSubMenus[];
|
|
27
23
|
isProduction: boolean;
|
|
28
24
|
hostname: string;
|
|
25
|
+
activeItem?: string;
|
|
29
26
|
hostNameOutSystems: string;
|
|
30
|
-
activeItem: string;
|
|
31
27
|
listaSubMenus: SubMenuItem[];
|
|
28
|
+
constructor(_menuService: MenuServicesService, _projectUtil: ProjectUtilservice);
|
|
32
29
|
ngOnInit(): void;
|
|
33
30
|
listaFunction(): void;
|
|
34
31
|
GetHostName(): void;
|
|
35
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<SubMenuComponent, never>;
|
|
36
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SubMenuComponent, "app-nav-sub-menu", never, { "navSubmenus": { "alias": "navSubmenus"; "required": false; }; "isProduction": { "alias": "isProduction"; "required": false; }; "hostname": { "alias": "hostname"; "required": false; }; }, {}, never, never, true, never>;
|
|
33
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SubMenuComponent, "app-nav-sub-menu", never, { "navSubmenus": { "alias": "navSubmenus"; "required": false; }; "isProduction": { "alias": "isProduction"; "required": false; }; "hostname": { "alias": "hostname"; "required": false; }; "activeItem": { "alias": "activeItem"; "required": false; }; }, {}, never, never, true, never>;
|
|
37
34
|
}
|
package/package.json
CHANGED
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';
|