本文整理汇总了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);
}
});
}
示例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()
);
};
}
示例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;
});
}
示例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;
});
}
示例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()}));
});
}
示例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());
}
示例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;
});
}
示例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;
});
}
示例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);
}
});
}
示例10: workstation
workstation() {
return this.auth.user() ? this.auth.workstation() : '';
}