Exemplo n.º 1
0
 private static function addAccessControlRule($policyId)
 {
     $rule = new kRule();
     $action = new kAccessControlDrmPolicyAction();
     $action->setPolicyId($policyId);
     $rule->setActions(array($action));
     return $rule;
 }
Exemplo n.º 2
0
 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;
 }