@fleetbase/ember-ui
Version:
Fleetbase UI provides all the interface components, helpers, services and utilities for building a Fleetbase extension into the Console.
7 lines (5 loc) • 317 B
JavaScript
import { helper } from '@ember/component/helper';
export default helper(function getWritePermission([model, schema = 'fleet-ops']) {
const modelName = model.constructor?.modelName ?? model._internalModel?.modelName;
return model.isNew ? `${schema} create ${modelName}` : `${schema} update ${modelName}`;
});