public function getCriterion(APILimitationValue $value, APIUserReference $currentUser)
{
if (empty($value->limitationValues)) {
// no limitation values
throw new \RuntimeException('$value->limitationValues is empty, it should not have been stored in the first place');
}
if ($value->limitationValues[0] != 1 && $value->limitationValues[0] != 2) {
throw new BadStateException('Parent User Group limitation', 'expected limitation value to be 1 but got:' . $value->limitationValues[0]);
}
return new Criterion\UserMetadata(Criterion\UserMetadata::OWNER, Criterion\Operator::EQ, $currentUser->getUserId());
}