function _applyAccessPolicy($object, $action) { $access_policy = new AccessPolicy(); $access_policy->applyAccessTemplates($object, $action); if (catch_error('LimbException', $e)) { } MessageBox::writeNotice("Access template of " . get_class($object) . " for action '{$action}' not defined!!!"); }
protected function _applyAccessPolicy($object, $action) { try { $access_policy = new AccessPolicy(); $access_policy->applyAccessTemplates($object, $action); } catch (LimbException $e) { MessageBox::writeNotice("Access template of " . get_class($object) . " for action '{$action}' not defined!!!"); } }
protected function _validPerform($request, $response) { if (!($class_id = $request->get('class_id'))) { throw new LimbException('class_id not defined'); } $data = $this->dataspace->export(); $access_policy = new AccessPolicy(); $access_policy->saveAccessTemplates($class_id, $data['template'], AccessPolicy::ACCESSOR_TYPE_GROUP); $request->setStatus(Request::STATUS_FORM_SUBMITTED); if ($request->hasAttribute('popup')) { $response->write(closePopupNoParentReloadResponse()); } }
function _validPerform(&$request, &$response) { $params = array(); $params['identifier'] = $this->dataspace->get('identifier'); $params['parent_path'] = $this->dataspace->get('parent_path'); $params['class'] = $this->dataspace->get('class_name'); $params['title'] = $this->dataspace->get('title'); $toolkit =& Limb::toolkit(); $object =& $toolkit->createSiteObject($params['Class']); $datasource =& $toolkit->getDatasource('SingleObjectDatasource'); $datasource->setPath($params['parent_path']); $is_root = false; if (!($parent_data = $datasource->fetch())) { if ($params['parent_path'] == '/') { $is_root = true; } else { MessageBox::writeNotice('parent wasn\'t retrieved by path ' . $params['parent_path']); $request->setStatus(Request::STATUS_FAILURE); return; } } if (!$is_root) { $params['parent_node_id'] = $parent_data['node_id']; } else { $params['parent_node_id'] = 0; } $object->merge($params); $object->create($is_root); if (catch_error($e, 'LimbException')) { MessageBox::writeNotice('object wasn\'t registered!'); $request->setStatus(Request::STATUS_FAILURE); return; } elseif (catch_error($e, 'LimbException')) { return throw_error($e); } if (!$is_root) { $parent_object =& $toolkit->createSiteObject($parent_data['ClassName']); $parent_object->merge($parent_data); $controller =& $parent_object->getController(); $action = $controller->determineAction(); $access_policy = new AccessPolicy(); $access_policy->saveNewObjectAccess($object, $parent_object, $action); } $request->setStatus(Request::STATUS_FORM_SUBMITTED); if ($request->hasAttribute('popup')) { $response->write(closePopupResponse($request)); } }
protected function _initDataspace($request) { $access_policy = new AccessPolicy(); $policy = $access_policy->getObjectsAccessByIds($this->object_ids, AccessPolicy::ACCESSOR_TYPE_GROUP); $this->dataspace->set('policy', $policy); }