public function before() { $ds_id = (int) Arr::get($this->request->query(), 'ds_id', $this->request->post('ds_id')); $this->section($ds_id); $this->_check_acl(); parent::before(); }
public function before() { if ($this->request->action() == 'edit') { $id = (int) $this->request->param('id'); $this->field = DataSource_Hybrid_Field_Factory::get_field($id); if (empty($this->field)) { throw new HTTP_Exception_404('Field ID :id not found', array(':id' => $id)); } $ds = $this->section($this->field->ds_id); if ($this->field->has_access_edit()) { $this->allowed_actions[] = 'edit'; } } if ($this->request->action() == 'add') { $ds_id = (int) $this->request->param('id'); $ds = $this->section($ds_id); if ($ds->has_access('field.create')) { $this->allowed_actions[] = 'add'; } } parent::before(); if (!empty($ds)) { $this->template_js_params['DS_ID'] = $ds->id(); } }
public function before() { if ($this->request->action() != 'create') { $ds_id = (int) $this->request->param('id'); $this->section($ds_id); if ($this->section()->has_access_edit()) { $this->allowed_actions[] = 'edit'; } if ($this->section()->has_access_remove()) { $this->allowed_actions[] = 'remove'; } } else { $type = strtolower($this->request->param('id')); if (ACL::check($type . '.section.create')) { $this->allowed_actions[] = 'create'; } } parent::before(); }