public function execute($request)
 {
     parent::execute($request);
     $this->permissions = array();
     if (null != $this->resource->id) {
         // Get term permissions for this group
         $criteria = new Criteria();
         $criteria->addJoin(QubitAclPermission::OBJECT_ID, QubitObject::ID, Criteria::LEFT_JOIN);
         $criteria->add(QubitAclPermission::GROUP_ID, $this->resource->id);
         $c1 = $criteria->getNewCriterion(QubitAclPermission::OBJECT_ID, null, Criteria::ISNULL);
         $c2 = $criteria->getNewCriterion(QubitObject::CLASS_NAME, 'QubitTerm');
         $c1->addOr($c2);
         $criteria->add($c1);
         $criteria->addAscendingOrderByColumn(QubitAclPermission::CONSTANTS);
         $criteria->addAscendingOrderByColumn(QubitAclPermission::OBJECT_ID);
         if (0 < count($permissions = QubitAclPermission::get($criteria))) {
             $this->permissions = $permissions;
         }
     }
     // List of actions without create or translate
     $this->basicActions = QubitAcl::$ACTIONS;
     unset($this->basicActions['read']);
     unset($this->basicActions['translate']);
     if ($request->isMethod('post')) {
         $this->form->bind($request->getPostParameters());
         if ($this->form->isValid()) {
             $this->processForm();
             $this->redirect(array($this->resource, 'module' => 'aclGroup', 'action' => 'indexTermAcl'));
         }
     }
 }
 public function execute($request)
 {
     parent::execute($request);
     // Always include root actor permissions
     $this->actors = array(QubitActor::ROOT_ID => null);
     // Get actor permissions for this resource
     $criteria = new Criteria();
     $criteria->addJoin(QubitAclPermission::OBJECT_ID, QubitObject::ID, Criteria::LEFT_JOIN);
     $criteria->add(QubitAclPermission::GROUP_ID, $this->resource->id);
     $c1 = $criteria->getNewCriterion(QubitAclPermission::OBJECT_ID, null, Criteria::ISNULL);
     $c2 = $criteria->getNewCriterion(QubitObject::CLASS_NAME, 'QubitActor');
     $c1->addOr($c2);
     $criteria->add($c1);
     if (null !== ($permissions = QubitAclPermission::get($criteria))) {
         foreach ($permissions as $p) {
             $this->actors[$p->objectId][$p->action] = $p;
         }
     }
     // List of actions without translate
     $this->basicActions = QubitAcl::$ACTIONS;
     unset($this->basicActions['translate']);
     if ($request->isMethod('post')) {
         $this->form->bind($request->getPostParameters());
         if ($this->form->isValid()) {
             $this->processForm();
             $this->redirect(array($this->resource, 'module' => 'aclGroup', 'action' => 'indexActorAcl'));
         }
     }
 }
 public function execute($request)
 {
     parent::execute($request);
     // Build separate list of permissions by repository and by object
     $this->repositories = array();
     $this->informationObjects = array();
     $this->root = array();
     if (null != $this->resource->id) {
         // Get info object permissions for this resource
         $criteria = new Criteria();
         $criteria->addJoin(QubitAclPermission::OBJECT_ID, QubitObject::ID, Criteria::LEFT_JOIN);
         $criteria->add(QubitAclPermission::GROUP_ID, $this->resource->id);
         $c1 = $criteria->getNewCriterion(QubitAclPermission::OBJECT_ID, null, Criteria::ISNULL);
         $c2 = $criteria->getNewCriterion(QubitObject::CLASS_NAME, 'QubitInformationObject');
         $c1->addOr($c2);
         $criteria->add($c1);
         $criteria->addAscendingOrderByColumn(QubitAclPermission::CONSTANTS);
         $criteria->addAscendingOrderByColumn(QubitAclPermission::OBJECT_ID);
         if (0 < count($permissions = QubitAclPermission::get($criteria))) {
             foreach ($permissions as $p) {
                 if (null != ($repoId = $p->getConstants(array('name' => 'repositoryId')))) {
                     $this->repositories[$repoId][$p->action] = $p;
                 } else {
                     if (null != $p->objectId && QubitInformationObject::ROOT_ID != $p->objectId) {
                         $this->informationObjects[$p->objectId][$p->action] = $p;
                     } else {
                         $this->root[$p->action] = $p;
                     }
                 }
             }
         }
     }
     // List of actions without translate
     $this->basicActions = QubitInformationObjectAcl::$ACTIONS;
     unset($this->basicActions['translate']);
     if ($request->isMethod('post')) {
         $this->form->bind($request->getPostParameters());
         if ($this->form->isValid()) {
             $this->processForm();
             $this->redirect(array($this->resource, 'module' => 'aclGroup', 'action' => 'indexInformationObjectAcl'));
         }
     }
 }