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


TypeScript service.AuthService.user方法代码示例

本文整理汇总了TypeScript中@eg/core/auth.service.AuthService.user方法的典型用法代码示例。如果您正苦于以下问题:TypeScript service.AuthService.user方法的具体用法?TypeScript service.AuthService.user怎么用?TypeScript service.AuthService.user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@eg/core/auth.service.AuthService的用法示例。


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

示例1: addToNew

    // Create a new bucket then add the record
    addToNew() {
        const bucket = this.idl.create('cbreb');

        bucket.owner(this.auth.user().id());
        bucket.name(this.newBucketName);
        bucket.description(this.newBucketDesc);
        bucket.btype(this.bucketType);

        this.net.request(
            'open-ils.actor',
            'open-ils.actor.container.create',
            this.auth.token(), 'biblio', bucket
        ).subscribe(bktId => {
            const evt = this.evt.parse(bktId);
            if (evt) {
                this.toast.danger(evt.desc);
            } else {
                // make it find-able to the queue-add method which
                // requires the bucket name.
                bucket.id(bktId);
                this.buckets.push(bucket);
                this.addToBucket(bktId);
            }
        });
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:26,代码来源:record-bucket-dialog.component.ts

示例2: constructor

    constructor(
        private router: Router,
        private pcrud: PcrudService,
        private auth: AuthService,
        private org: OrgService) {

        this.gridSource = new GridDataSource();
        this.contextOrg = this.org.get(this.auth.user().ws_ou());

        this.gridSource.getRows = (pager: Pager) => {
            const orgs = this.org.ancestors(this.contextOrg, true);
            return this.pcrud.search('vms', {owner: orgs}, {
                order_by: {vms: ['name']},
                limit: pager.limit,
                offset: pager.offset
            });
        };

        this.createNew = () => {
            this.editDialog.mode = 'create';
            this.editDialog.open({size: 'lg'}).then(
                ok => this.grid.reload(),
                err => {}
            );
        };

        this.deleteSelected = (matchSets: IdlObject[]) => {
            matchSets.forEach(matchSet => matchSet.isdeleted(true));
            this.pcrud.autoApply(matchSets).subscribe(
                val => console.debug('deleted: ' + val),
                err => {},
                ()  => this.grid.reload()
            );
        };
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:35,代码来源:match-set-list.component.ts

示例3: getItemImportDefs

    getItemImportDefs(): Promise<IdlObject[]> {
        if (this.importItemAttrDefs) {
            return Promise.resolve(this.importItemAttrDefs);
        }

        const owners = this.org.ancestors(this.auth.user().ws_ou(), true);
        return this.pcrud.search('viiad', {owner: owners}, {}, {atomic: true})
        .toPromise().then(defs => {
            this.importItemAttrDefs = defs;
            return defs;
        });
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:12,代码来源:vandelay.service.ts

示例4: getMergeProfiles

    getMergeProfiles(): Promise<IdlObject[]> {
        if (this.mergeProfiles) {
            return Promise.resolve(this.mergeProfiles);
        }

        const owners = this.org.ancestors(this.auth.user().ws_ou(), true);
        return this.pcrud.search('vmp',
            {owner: owners}, {order_by: {vmp: ['name']}}, {atomic: true})
        .toPromise().then(profiles => {
            this.mergeProfiles = profiles;
            return profiles;
        });
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:13,代码来源:vandelay.service.ts

示例5: getBillingTypes

 // Fetch-cache billing types
 async getBillingTypes(): Promise<any> {
     if (this.billingTypes.length > 1) {
         return Promise.resolve();
     }
     return this.pcrud.search('cbt',
         {owner: this.org.fullPath(this.auth.user().ws_ou(), true)},
         {}, {atomic: true}
     ).toPromise().then(bts => {
         this.billingTypes = bts
             .sort((a, b) => a.name() < b.name() ? -1 : 1)
             .map(bt => ({id: bt.id(), label: bt.name()}));
     });
 }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:14,代码来源:mark-damaged-dialog.component.ts

示例6: ngOnInit

    ngOnInit() {

        this.holdType = this.route.snapshot.params['type'];
        this.holdTargets = this.route.snapshot.queryParams['target'];

        if (!Array.isArray(this.holdTargets)) {
            this.holdTargets = [this.holdTargets];
        }

        this.holdTargets = this.holdTargets.map(t => Number(t));
        this.holdFor = 'patron';
        this.requestor = this.auth.user();
        this.pickupLib = this.auth.user().ws_ou();

        this.holdContexts = this.holdTargets.map(target => {
            const ctx = new HoldContext(target);
            return ctx;
        });

        this.getTargetMeta();

        this.org.settings('sms.enable').then(sets => {
            this.smsEnabled = sets['sms.enable'];
            if (!this.smsEnabled) { return; }

            this.pcrud.search('csc', {active: 't'}, {order_by: {csc: 'name'}})
            .subscribe(carrier => {
                this.smsCarriers.push({
                    id: carrier.id(),
                    label: carrier.name()
                });
            });
        });

        setTimeout(() => // Focus barcode input
            this.renderer.selectRootElement('#patron-barcode').focus());
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:37,代码来源:hold.component.ts

示例7: getBibTrashGroups

    getBibTrashGroups(): Promise<any> {
        if (this.bibTrashGroups) {
            return Promise.resolve(this.bibTrashGroups);
        }

        const owners = this.org.ancestors(this.auth.user().ws_ou(), true);

        return this.pcrud.search('vibtg',
            {always_apply : 'f', owner: owners},
            {vibtg : ['label']},
            {atomic: true}
        ).toPromise().then(groups => {
            this.bibTrashGroups = groups;
            return groups;
        });
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:16,代码来源:vandelay.service.ts

示例8: getMatchSets

    // todo: differentiate between biblio and authority a la queue api
    getMatchSets(mtype: string): Promise<IdlObject[]> {

        const mstype = mtype.match(/bib/) ? 'biblio' : 'authority';

        if (this.matchSets[mtype]) {
            return Promise.resolve(this.matchSets[mtype]);
        } else {
            this.matchSets[mtype] = [];
        }

        const owners = this.org.ancestors(this.auth.user().ws_ou(), true);

        return this.pcrud.search('vms',
            {owner: owners, mtype: mstype}, {}, {atomic: true})
        .toPromise().then(sets => {
            this.matchSets[mtype] = sets;
            return sets;
        });
    }
开发者ID:StephenGWills,项目名称:Evergreen,代码行数:20,代码来源:vandelay.service.ts

示例9: addToNew

    // Create a new bucket then add the record
    addToNew() {
        const bucket = this.idl.create('cbreb');

        bucket.owner(this.auth.user().id());
        bucket.name(this.newBucketName);
        bucket.description(this.newBucketDesc);
        bucket.btype('staff_client');

        this.net.request(
            'open-ils.actor',
            'open-ils.actor.container.create',
            this.auth.token(), 'biblio', bucket
        ).subscribe(bktId => {
            const evt = this.evt.parse(bktId);
            if (evt) {
                this.toast.danger(evt.desc);
            } else {
                this.addToBucket(bktId);
            }
        });
    }
开发者ID:jamesrf,项目名称:Evergreen,代码行数:22,代码来源:record-bucket-dialog.component.ts

示例10: workstation

 workstation() {
     return this.auth.user() ? this.auth.workstation() : '';
 }
开发者ID:jamesrf,项目名称:Evergreen,代码行数:3,代码来源:nav.component.ts


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