111 Security: Test - chempkovsky/CS82ANGULAR GitHub Wiki

Notes

Redundant navigation and redundant menu items

  • All is fine except navigation
    • aspnetmodelView -> aspnetusermaskView
    • it always returns empty list
Click to show the picture

project structure

  • To eliminate redundant navigation, we need to change the code for the following components:
    • Rvform
    • rlist
    • rdlist

Rvform

  • open the src\app\components\aspnetuserroles-view\rvform\aspnetuserroles-view-r-v.component.ts-file and modify detailViews-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'},
    ];

rlist

  • open the src\app\components\aspnetuserroles-view\rlist\aspnetuserroles-view-rlist.component.ts-file and 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;
    }

rdlist

  • 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;
    }

Test

  • Redundant navigation and extra menu items are gone
Click to show the picture

project structure

⚠️ **GitHub.com Fallback** ⚠️