-
Notifications
You must be signed in to change notification settings - Fork 0
111 Security: Test
chempkovsky edited this page Jun 7, 2022
·
1 revision
- read the article 110
- When you launch the application for the very first time, please register as a user
z@gmaiil.com
with a password5Z@gmaiil.com
(the second letter is capitalized).- After that you can login as Admin and as Guest
-
admin@gmail.com
with a password5Admin@gmail.com
(the second letter is capitalized)- "AdminRole" will be assigned to this user
-
guest@gmail.com
with a password5Guest@gmail.com
(the second letter is capitalized)- "GuestRole" will be assigned to this user
-
- After that you can login as Admin and as Guest
- When you launch the application for the very first time, please register as a user
- All is fine except navigation
-
aspnetmodelView
->aspnetusermaskView
- it always returns empty list
-
Click to show the picture
- To eliminate redundant navigation, we need to change the code for the following components:
- Rvform
- rlist
- rdlist
- open the
src\app\components\aspnetuserroles-view\rvform\aspnetuserroles-view-r-v.component.ts
-file and modifydetailViews
-array as follows:
public detailViews: Array<{caption: string, vw: string|null, nv: string|null, addon: string|null}> = [
{caption:this.frases['Hide-details'], vw:null, nv:null, addon: null},
{caption:this.frases['aspnetrolemaskViewAspNetModel'], vw: 'aspnetrolemaskView', nv: 'AspNetModel', addon: 'aspnetrolemaskView'},
// {caption:this.frases['aspnetusermaskViewAspNetModel'], vw: 'aspnetusermaskView', nv: 'AspNetModel', addon: 'aspnetusermaskView'},
];
- open the
src\app\components\aspnetuserroles-view\rlist\aspnetuserroles-view-rlist.component.ts
-file and modifydetailViews
-array as follows:
public detailViews: Array<{caption: string, vw: string|null, nv: string|null, addon: string|null}> = [
{caption:'Hide details', vw:null, nv:null, addon: null},
{caption: this.frases['aspnetrolemaskViewAspNetModel'], vw: 'aspnetrolemaskView', nv: 'AspNetModel', addon: 'aspnetrolemaskView'},
// {caption: this.frases['aspnetusermaskViewAspNetModel'], vw: 'aspnetusermaskView', nv: 'AspNetModel', addon: 'aspnetusermaskView'},
];
- modify
ngOnInit()
-method as follows:
ngOnInit() {
...
this.rowMenuItemsData[0].enabled = this.rowMenuItemsData[0].enabled && (!this.extfltrOn) && ((this.permMask & 4) === 4) ; // modify
this.rowMenuItemsData[1].enabled = this.rowMenuItemsData[1].enabled && (!this.extfltrOn) && ((this.permMask & 2) === 2) ; // delete
this.rowMenuItemsData[2].enabled = this.rowMenuItemsData[2].enabled && (!this.extfltrOn) ; // view
if(!this.isdtl) {
let msk: number = 0;
...
/*
msk = this.appGlblSettings.getViewModelMask('aspnetusermaskView');
if((msk & 1) === 1) {
this.rowMenuItemsData.push(
{ id: '2', caption: this.frases['aspnetusermaskViewAspNetModel'], iconName: 'arrow_forward', iconColor: 'primary', enabled: true,
data: {
view: 'aspnetusermaskView',
nav: 'AspNetModel',
addon: 'aspnetusermaskView'
}
}
);
}
*/
...
}
this.selectedDetail = this.detailViews[0];
this.showDetails = !this.isdtl;
this.isOnInitCalled = true;
}
- open the
src\app\components\aspnetuserroles-view\rdlist\aspnetuserroles-view-rdlist.component.ts
-file - modify
detailViews
-array as follows:
public detailViews: Array<{caption: string, vw: string|null, nv: string|null, addon: string|null}> = [
{caption:'Hide details', vw:null, nv:null, addon: null},
{caption: this.frases['aspnetrolemaskViewAspNetModel'], vw: 'aspnetrolemaskView', nv: 'AspNetModel', addon: 'aspnetrolemaskView'},
// {caption: this.frases['aspnetusermaskViewAspNetModel'], vw: 'aspnetusermaskView', nv: 'AspNetModel', addon: 'aspnetusermaskView'},
];
- modify
ngOnInit()
-method as follows:
ngOnInit() {
...
this.rowMenuItemsData[0].enabled = this.rowMenuItemsData[0].enabled && (!this.extfltrOn) && ((this.permMask & 4) === 4) ; // modify
this.rowMenuItemsData[1].enabled = this.rowMenuItemsData[1].enabled && (!this.extfltrOn) && ((this.permMask & 2) === 2) ; // delete
this.rowMenuItemsData[2].enabled = this.rowMenuItemsData[2].enabled && (!this.extfltrOn) ; // view
if(!this.isdtl) {
let msk: number = 0;
...
/*
msk = this.appGlblSettings.getViewModelMask('aspnetusermaskView');
if((msk & 1) === 1) {
this.rowMenuItemsData.push(
{ id: '2', caption: this.frases['aspnetusermaskViewAspNetModel'], iconName: 'arrow_forward', iconColor: 'primary', enabled: true,
data: {
view: 'aspnetusermaskView',
nav: 'AspNetModel',
addon: 'aspnetusermaskView'
}
}
);
}
*/
...
}
this.selectedDetail = this.detailViews[0];
this.showDetails = !this.isdtl;
this.isOnInitCalled = true;
}
- Redundant navigation and extra menu items are gone