mirror of
https://github.com/nasa/openmct.git
synced 2025-05-02 08:43:17 +00:00
27 lines
634 B
JavaScript
27 lines
634 B
JavaScript
/*global define*/
|
|
|
|
define(
|
|
[],
|
|
function () {
|
|
"use strict";
|
|
|
|
/**
|
|
* Policy allowing composition only for domain object types which
|
|
* have a composition property.
|
|
* @constructor
|
|
* @memberof platform/containment
|
|
* @implements {Policy.<Type, Type>}
|
|
*/
|
|
function CompositionModelPolicy() {
|
|
}
|
|
|
|
CompositionModelPolicy.prototype.allow = function (candidate, context) {
|
|
return Array.isArray(
|
|
(candidate.getInitialModel() || {}).composition
|
|
);
|
|
};
|
|
|
|
return CompositionModelPolicy;
|
|
}
|
|
);
|