mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 17:57:04 +00:00
Revert "[LinkService] Reorder/refactor validation"
This reverts commit c17269ba8bc7cff3ee2481d1b2c9b14bbba7c34f.
This commit is contained in:
parent
4743833f7c
commit
8db334e45b
@ -39,17 +39,20 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
LinkService.prototype.validate = function (object, parentCandidate) {
|
LinkService.prototype.validate = function (object, parentCandidate) {
|
||||||
var objectId = object.getId();
|
if (!parentCandidate || !parentCandidate.getId) {
|
||||||
return !!parentCandidate &&
|
return false;
|
||||||
!!parentCandidate.getId &&
|
}
|
||||||
parentCandidate.getId() !== objectId &&
|
if (parentCandidate.getId() === object.getId()) {
|
||||||
parentCandidate.hasCapability("composition") &&
|
return false;
|
||||||
parentCandidate.getModel().composition.indexOf(objectId) === -1 &&
|
}
|
||||||
this.policyService.allow(
|
if ((parentCandidate.getModel().composition || []).indexOf(object.getId()) !== -1) {
|
||||||
"composition",
|
return false;
|
||||||
parentCandidate.getCapability('type'),
|
}
|
||||||
object.getCapability('type')
|
return this.policyService.allow(
|
||||||
);
|
"composition",
|
||||||
|
parentCandidate.getCapability('type'),
|
||||||
|
object.getCapability('type')
|
||||||
|
) && parentCandidate.hasCapability('composition');
|
||||||
};
|
};
|
||||||
|
|
||||||
LinkService.prototype.perform = function (object, parentObject) {
|
LinkService.prototype.perform = function (object, parentObject) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user