Composition policy takes child instance
The composition policy now takes a child instance instead of the child type, as in all cases we have access to the child object. This allows new-style objects to be contained by old-style objects. Updated all composition policies to use standardized argument names instead of `context` and `candidate`; this makes it easier to understand. Updated AddActionProvider to hardcode the object types supported.
This commit is contained in:
@@ -48,7 +48,7 @@ define(
|
||||
return this.policyService.allow(
|
||||
"composition",
|
||||
parentCandidate.getCapability('type'),
|
||||
object.getCapability('type')
|
||||
object
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ define(
|
||||
return this.policyService.allow(
|
||||
"composition",
|
||||
parentCandidate.getCapability('type'),
|
||||
object.getCapability('type')
|
||||
object
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ define(
|
||||
return this.policyService.allow(
|
||||
"composition",
|
||||
parentCandidate.getCapability('type'),
|
||||
object.getCapability('type')
|
||||
object
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user