Files
dspace-angular/src/app/+item-page/edit-item-page/item-operation/itemOperation.model.ts
2021-04-08 17:54:27 +02:00

32 lines
885 B
TypeScript

import { FeatureID } from '../../../core/data/feature-authorization/feature-id';
/**
* Represents an item operation used on the edit item page with a key, an operation URL to which will be navigated
* when performing the action and an option to disable the operation.
*/
export class ItemOperation {
operationKey: string;
operationUrl: string;
disabled: boolean;
authorized: boolean;
featureID: FeatureID;
constructor(operationKey: string, operationUrl: string, featureID?: FeatureID, disabled = false, authorized = true) {
this.operationKey = operationKey;
this.operationUrl = operationUrl;
this.featureID = featureID;
this.authorized = authorized;
this.setDisabled(disabled);
}
/**
* Set whether this operation should be disabled
* @param disabled
*/
setDisabled(disabled: boolean): void {
this.disabled = disabled;
}
}