Skip to content

Commit 81db21e

Browse files
author
=
committed
header and user permissions
1 parent fd424d5 commit 81db21e

File tree

13 files changed

+48
-40
lines changed

13 files changed

+48
-40
lines changed

README.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@
55

66
# Mixeway User Interface <img src="https://mixeway.github.io/img/logo_dashboard.png" height="60px">
77

8-
### Disclaimer:
9-
> The current version of Mixaway (0.9) is considered as beta. It contains several bugs and vulnerabilities. Every fix
10-
is put on the board and proceed to make sure version 1.0 will be vulnerability and bug-free.
11-
12-
138
### About Mixeway:
149
Mixeway is an OpenSource software that is meant to simplify the process of security assurance of projects which are implemented using CICD procedures. **Mixawey is not another vulnerability scanning
1510
software - it is security orchestration tool**.
11+
Mixeway frontend is based on ngx-admin dashboard - https://github.com/akveo/ngx-admin
1612

1713
With number of plugins for Vulnerability Scanners :
1814
<img src="https://mixeway.github.io/img/nessus.png" height="50px">

src/app/@core/constants/AdminConstants.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ export class AdminConstants {
3636
'name': 'Admin',
3737
'id': 'ROLE_ADMIN',
3838
},
39+
{
40+
'name': 'Auditor',
41+
'id': 'ROLE_AUDITOR',
42+
},
3943
{
4044
'name': 'Viewer',
4145
'id': 'ROLE_USER',
@@ -47,12 +51,7 @@ export class AdminConstants {
4751
{
4852
'name': 'API',
4953
'id': 'ROLE_API',
50-
},
51-
{
52-
'name': 'CICD',
53-
'id': 'ROLE_API_CICD',
54-
},
55-
];
54+
}];
5655
OPERATION_SUCCESS_PROXY_DELETE: string = 'The Proxy is successfully deleted.';
5756
ADMIN_PAGE_TITLE: string = 'Admin panel';
5857
ADMIN_TAB_USERS: string = 'Users';
@@ -153,6 +152,7 @@ export class AdminConstants {
153152
ADMIN_FORM_PROJECTS = 'Permissions for projects';
154153
ADMIN_FORM_PROJECTS2 = 'Select projects...';
155154
ADMIN_ROLE_USER = 'ROLE_USER';
155+
ADMIN_ROLE_USER2 = 'ROLE_EDITOR_RUNNER';
156156
ADMIN_FORM_EDIT = 'Edit';
157157
ADMIN_EDIT_USER = 'Editing user';
158158
ADMIN_TOOLTIP_EDIT = 'Edit user';

src/app/@theme/components/header/header.component.html

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
nbTooltip="Swagger API REST"></nb-icon>
1717
</nb-action>
1818
<nb-action class="control-item">
19-
<nb-icon icon="question-mark-circle-outline" pack="eva" [options]="{ animation: { type: 'pulse' } }" (click)="showTutorialWizzard()" nbTooltip="Tutorial"></nb-icon>
19+
<nb-icon icon="github-outline" pack="eva" [options]="{ animation: { type: 'pulse' } }" (click)="openGitHub()"
20+
nbTooltip="GitHub Docs"></nb-icon>
21+
</nb-action>
22+
<nb-action class="control-item">
23+
<nb-icon icon="bulb-outline" pack="eva" [options]="{ animation: { type: 'pulse' } }" (click)="openTutorials()"
24+
nbTooltip="Tutorials"></nb-icon>
2025
</nb-action>
2126
<nb-action class="control-item">
2227
<nb-search type="rotate-layout" nbTooltip="Look for..."></nb-search>

src/app/@theme/components/header/header.component.ts

+13-10
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {LayoutService} from '../../../@core/utils';
1010
import { Subject } from 'rxjs';
1111
import {DashboardService} from '../../../@core/service/DashboardService';
1212
import {Router} from '@angular/router';
13-
import {StepperComponent} from '../stepper/stepper.component';
1413
import {CookieService} from 'ngx-cookie-service';
1514

1615
@Component({
@@ -33,10 +32,12 @@ export class HeaderComponent implements OnInit, OnDestroy {
3332
},
3433
];
3534

36-
currentTheme = 'material-lightś';
35+
currentTheme = 'material-light';
3736

3837
userMenu = [ { title: 'Profile' }, { title: 'Log out' } ];
3938

39+
docsMenu = [ {title: 'Swagger'}, { title: 'GitHub' }, { title: 'Tutorials' } ];
40+
4041
constructor(private sidebarService: NbSidebarService,
4142
private menuService: NbMenuService,
4243
private themeService: NbThemeService,
@@ -49,6 +50,7 @@ export class HeaderComponent implements OnInit, OnDestroy {
4950
this.menuService.onItemClick().subscribe(( event ) => {
5051
this.onItemSelection(event.item.title);
5152
});
53+
5254
this.searchService.onSearchSubmit()
5355
.subscribe((data: any) => {
5456
this.router.routeReuseStrategy.shouldReuseRoute = function () {
@@ -77,9 +79,6 @@ export class HeaderComponent implements OnInit, OnDestroy {
7779
getUserName() {
7880
return this.dashboardService.getSessionOwner().subscribe(data => {
7981
this.user = data;
80-
if (this.user.logins < 2) {
81-
this.showTutorialWizzard();
82-
}
8382
});
8483
}
8584

@@ -104,11 +103,7 @@ export class HeaderComponent implements OnInit, OnDestroy {
104103
this.menuService.navigateHome();
105104
return false;
106105
}
107-
showTutorialWizzard() {
108-
this.dialogService.open(
109-
StepperComponent,
110-
{ context: 'this is some additional data passed to dialog' });
111-
}
106+
112107

113108
showSwaggerDoc() {
114109
window.location.href = '/swagger-ui.html';
@@ -119,4 +114,12 @@ export class HeaderComponent implements OnInit, OnDestroy {
119114
this.themeService.changeTheme(theme[0].value);
120115
}
121116
}
117+
118+
openGitHub() {
119+
window.location.href = 'https://github.com/mixeway/mixewayhub';
120+
}
121+
122+
openTutorials() {
123+
window.location.href = 'https://mixeway.io/category/tutorial/';
124+
}
122125
}

src/app/@theme/theme.module.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ import { ModuleWithProviders, NgModule } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33
import { MatRippleModule } from '@angular/material/core';
44
import {
5-
NbActionsModule,
6-
NbLayoutModule,
7-
NbMenuModule,
8-
NbSearchModule,
9-
NbSidebarModule,
10-
NbUserModule,
11-
NbContextMenuModule,
12-
NbButtonModule,
13-
NbSelectModule,
14-
NbIconModule,
15-
NbThemeModule,
5+
NbActionsModule,
6+
NbLayoutModule,
7+
NbMenuModule,
8+
NbSearchModule,
9+
NbSidebarModule,
10+
NbUserModule,
11+
NbContextMenuModule,
12+
NbButtonModule,
13+
NbSelectModule,
14+
NbIconModule,
15+
NbThemeModule, NbTooltipModule,
1616
} from '@nebular/theme';
1717
import { NbEvaIconsModule } from '@nebular/eva-icons';
1818
import { NbSecurityModule } from '@nebular/security';
@@ -74,7 +74,7 @@ const PIPES = [
7474
];
7575

7676
@NgModule({
77-
imports: [CommonModule, MatRippleModule, ...NB_MODULES],
77+
imports: [CommonModule, MatRippleModule, ...NB_MODULES, NbTooltipModule],
7878
exports: [CommonModule, MatRippleModule, ...PIPES, ...COMPONENTS],
7979
declarations: [...COMPONENTS, ...PIPES],
8080
})

src/app/pages/admin/user/user.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
<label for="userPassword" class="label">{{constants.ADMIN_FORM_USER_PASSWORD}} </label>
6060
<input type="password" nbInput fullWidth id="userPassword" [placeholder]="constants.ADMIN_FORM_USER_PASSWORD" formControlName="userPassword">
6161
</div>
62-
<div class="form-group" *ngIf="userForm.value.userRole == constants.ADMIN_ROLE_USER">
62+
<div class="form-group" *ngIf="( userForm.value.userRole==constants.ADMIN_ROLE_USER)">
6363
<label for="permissionsProject" class="label">{{constants.ADMIN_FORM_PROJECTS}}</label>
6464
<ejs-multiselect formControlName="projects" id="permissionsProject" [dataSource]='projects' [fields]='fields' (filtering)='onFiltering($event)' [allowFiltering]='true'
6565
[placeholder]='constants.ADMIN_FORM_PROJECTS2'></ejs-multiselect>

src/app/pages/admin/user/user.component.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { EmitType } from '@syncfusion/ej2-base/src/base';
1919
})
2020
export class UserComponent implements OnInit {
2121
@ViewChild('apiKeyModal', { read: TemplateRef }) apiKeyModal: TemplateRef<HTMLElement>;
22-
asd: any = 'ROLE_EDITOR_RUNNER';
2322
proxies: Proxies[];
2423
projects: { [key: string]: Object; }[] = [];
2524
auth: boolean;
@@ -90,7 +89,7 @@ export class UserComponent implements OnInit {
9089
this.toast.showToast('success', this.constants.TOAST_SUCCESS, this.constants.OPERATION_SUCCESS_USER_SAVE);
9190
this.loadUsers();
9291
ref.close();
93-
if (this.userForm.value.userRole === 'ROLE_API_CICD') {
92+
if (this.userForm.value.userRole === 'ROLE_API') {
9493
this.windowService.open(
9594
this.apiKeyModal,
9695
{ title: this.constants.ADMIN_APIKEY_MODAL_HEADER, context: data },
@@ -168,10 +167,10 @@ export class UserComponent implements OnInit {
168167
}
169168

170169
changedRole($event: any) {
171-
if ($event === 'ROLE_USER' || $event === 'ROLE_ADMIN' || $event === 'ROLE_EDITOR_RUNNER' || $event === 'ROLE_API') {
170+
if ($event === 'ROLE_USER' || $event === 'ROLE_ADMIN' || $event === 'ROLE_AUDITOR' || $event === 'ROLE_EDITOR_RUNNER') {
172171
this.showUsername = true;
173172
this.showOptions = true;
174-
} else if ($event === 'ROLE_API_CICD') {
173+
} else if ($event === 'ROLE_API') {
175174
this.showUsername = true;
176175
this.showOptions = false;
177176
}

src/app/pages/pages-menu-user.ts

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ export const MENU_ITEMS_USER: NbMenuItem[] = [
1010
title: 'Statistics',
1111
group: true,
1212
},
13+
{
14+
title: 'Vulnerabilities',
15+
icon: 'bar-chart-outline',
16+
link: '/pages/vulns',
17+
},
1318
{
1419
title: 'CI/CD',
1520
icon: 'pie-chart-outline',

src/app/pages/user-profile/user-profile.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
CICD Api Key
7777
</nb-card-header>
7878
<nb-card-body>
79-
<button nbButton status="primary" (click)="generateApiKey()"><nb-icon icon="refresh"></nb-icon>Generate new CICD Api Key (old one will be disabled)</button>
79+
<button nbButton status="primary" (click)="generateApiKey()"><nb-icon icon="refresh"></nb-icon>Generate new Api Key (old one will be disabled)</button>
8080
</nb-card-body>
8181
</nb-card>
8282
</nb-card-footer>
Binary file not shown.
Loading
Binary file not shown.

src/assets/images/mixeway_scanner.png

48.4 KB
Loading

0 commit comments

Comments
 (0)