Exemplo n.º 1
0
 public function addRestriction($constraintName, $action, IRestriction $restriction)
 {
     $accessConstraint = null;
     if (array_key_exists($constraintName, $this->m_accessConstraints)) {
         $accessConstraint = $this->m_accessConstraints[$constraintName];
     } else {
         $accessConstraint = new AccessConstraint($constraintName, $action);
     }
     $accessConstraint->addRestriction($restriction);
     $orbconfig = ORBConfig::getInstance();
     $configHandler = $orbconfig->getConfig("weborb/security");
     $configHandler->addRestriction($constraintName, $action, $restriction);
     //return;
     $configHandler->saveConfig();
 }
 public function addRestriction($constraintName, $action, IRestriction $restriction)
 {
     $accessConstraintElement = $this->getAccessConstraintElement($constraintName);
     // return;
     if ($accessConstraintElement == null) {
         //return;
         $accessConstraint = new AccessConstraint($constraintName, $action);
         //return;
         $accessConstraint->addRestriction($restriction);
         //return;
         $this->addAccessConstraint($accessConstraint);
     } else {
         $this->addRestriction2($accessConstraintElement, $restriction);
     }
 }