本文整理匯總了TypeScript中@eg/core/perm.service.PermService.hasWorkPermHere方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.PermService.hasWorkPermHere方法的具體用法?TypeScript service.PermService.hasWorkPermHere怎麽用?TypeScript service.PermService.hasWorkPermHere使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@eg/core/perm.service.PermService
的用法示例。
在下文中一共展示了service.PermService.hasWorkPermHere方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
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]);
}
},
示例2: 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')
);
};
}