示例#1
0
 private function deleteOneNegative(array $right)
 {
     $result = RightTable::delete($right['ID']);
     if ($result->isSuccess()) {
         $this->errorCollection->addFromResult($result);
         return false;
     }
     $firstNegative = false;
     foreach ($this->getParentRights() as $parentRight) {
         if ($this->isEqual($parentRight, $right)) {
             $firstNegative = true;
             break;
         }
         if ($this->isOpposite($parentRight, $right)) {
             $firstNegative = false;
             break;
         }
     }
     if ($firstNegative) {
         //parent negative is like current negative right ($right)
         return true;
     }
     /**
      * Insert all simple rights in sub-tree before positive rights and negative rights.
      */
     return true;
 }