private static function addAccessControlRule($policyId) { $rule = new kRule(); $action = new kAccessControlDrmPolicyAction(); $action->setPolicyId($policyId); $rule->setActions(array($action)); return $rule; }
private static function addAccessControlRule($priviledge, $policyId) { $rule = new kRule(); $condition = new kAuthenticatedCondition(); $condition->setPrivileges(array($priviledge)); $action = new kAccessControlDrmPolicyAction(); $action->setPolicyId($policyId); $rule->setConditions(array($condition)); $rule->setActions(array($action)); return $rule; }
public function applyContext(kEntryContextDataResult $context) { $fulfilled = parent::applyContext($context); if ($fulfilled) { foreach ($this->actions as $action) { if ($action instanceof kAccessControlPreviewAction) { $context->setPreviewLength($action->getLimit()); } } } return $fulfilled; }