当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript perm.service.PermService类代码示例

本文整理汇总了TypeScript中@eg/core/perm.service.PermService的典型用法代码示例。如果您正苦于以下问题:TypeScript service.PermService类的具体用法?TypeScript service.PermService怎么用?TypeScript service.PermService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了service.PermService类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: Promise

 return new Promise((resolve, reject) => {
     this.perm.hasWorkPermAt(['STAFF_LOGIN']).then(
         permMap => {
             if (permMap.STAFF_LOGIN.length) {
                 resolve('perm check OK');
             } else {
                 reject('perm check faield');
             }
         }
     );
 });
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:11,代码来源:resolver.service.ts

示例2:

            request => {
                console.log('hold returned: ', request);
                ctx.lastRequest = request;
                ctx.processing = false;

                // If this request failed and was not already an override,
                // see of this user has permission to override.
                if (!request.override &&
                    !request.result.success && request.result.evt) {

                    const txtcode = request.result.evt.textcode;
                    const perm = txtcode + '.override';

                    return this.perm.hasWorkPermHere(perm).then(
                        permResult => ctx.canOverride = permResult[perm]);
                }
            },
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:17,代码来源:hold.component.ts

示例3: ngOnInit

    ngOnInit() {
        this.initDone = true;

        // Load edit perms
        this.perm.hasWorkPermHere([
            'CREATE_MONOGRAPH_PART',
            'UPDATE_MONOGRAPH_PART',
            'DELETE_MONOGRAPH_PART'
        ]).then(perms => this.permissions = perms);

        this.gridDataSource.getRows = (pager: Pager, sort: any[]) => {
            const orderBy: any = {};

            if (sort.length) { // Sort provided by grid.
                orderBy.bmp = sort[0].name + ' ' + sort[0].dir;
            } else {
                orderBy.bmp = 'label';
            }

            const searchOps = {
                offset: pager.offset,
                limit: pager.limit,
                order_by: orderBy
            };

            return this.pcrud.search('bmp',
                {record: this.recId, deleted: 'f'}, searchOps);
        };

        this.partsGrid.onRowActivate.subscribe(
            (part: IdlObject) => {
                this.editDialog.mode = 'update';
                this.editDialog.recId = part.id();
                this.editDialog.open().then(
                    ok => this.partsGrid.reload(),
                    err => {}
                );
            }
        );

        this.createNew = () => {

            const part = this.idl.create('bmp');
            part.record(this.recId);
            this.editDialog.record = part;

            this.editDialog.mode = 'create';
            this.editDialog.open().then(
                ok => this.partsGrid.reload(),
                err => {}
            );
        };

        this.deleteSelected = (parts: IdlObject[]) => {
            parts.forEach(part => part.isdeleted(true));
            this.pcrud.autoApply(parts).subscribe(
                val => console.debug('deleted: ' + val),
                err => {},
                ()  => this.partsGrid.reload()
            );
        };

        this.mergeSelected = (parts: IdlObject[]) => {
            if (parts.length < 2) { return; }
            this.mergeDialog.parts = parts;
            this.mergeDialog.open().then(
                ok => this.partsGrid.reload(),
                err => console.debug('Dialog dismissed')
            );
        };
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:71,代码来源:parts.component.ts


注:本文中的@eg/core/perm.service.PermService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。