function _authorize() { parent::_authorize(); if ($this->Auth->user('type') != "Estudiante" && $this->Auth->user('type') == "Becario") { return false; } return true; }
function _authorize() { parent::_authorize(); $private_actions = array("add"); if ($this->Auth->user('type') != "Administrador" && $this->Auth->user('type') != "Administrativo") { return false; } $this->set('section', 'courses'); return true; }
function _authorize() { parent::_authorize(); $private_actions = array("index", "add", "edit", "get_register_info"); if ($this->Auth->user('type') != "Profesor" && $this->Auth->user('type') != "Administrador" && $this->Auth->user('type') != "Administrativo" && $this->Auth->user('type') != "Becario") { return false; } if ($this->Auth->user('type') != "Administrador" && $this->Auth->user('type') != "Becario" && $this->Auth->user('type') != "Administrativo" && array_search($this->params['action'], $private_actions) !== false) { return false; } $this->set('section', 'attendance_registers'); return true; }
function _authorize() { parent::_authorize(); $private_actions = array('schedule', 'add', 'edit', 'update', 'delete', 'update_teacher'); $student_actions = array('register_student'); if (array_search($this->params['action'], $private_actions) !== false && $this->Auth->user('type') != "Administrador" && $this->Auth->user('type') != "Profesor") { return false; } if (array_search($this->params['action'], $student_actions) !== false && $this->Auth->user('type') != "Estudiante") { return false; } return true; }
function _authorize() { parent::_authorize(); $administrator_actions = array('add', 'edit', 'delete'); $this->set('section', 'courses'); if (array_search($this->params['action'], $administrator_actions) !== false && $this->Auth->user('type') != "Administrador" && $auth->user('type') != "Administrativo") { return false; } return true; }
function _authorize() { parent::_authorize(); $administrator_actions = array('add', 'edit', 'delete'); $this->set('section', 'courses'); if (array_search($this->params['action'], $administrator_actions) !== false && $this->Auth->user('type') != "Administrador") { if ($this->params['action'] == 'add' || $this->params['action'] == 'delete') { return false; } $user_id = $this->Auth->user('id'); $subject = $this->_get_subject(); if ($subject['Subject']['coordinator_id'] != $user_id && $subject['Subject']['practice_responsible_id'] != $user_id) { return false; } } return true; }
function _authorize() { parent::_authorize(); $this->set('section', 'users'); $administrator_actions = array('delete', 'import'); $administrative_actions = array('edit_registration', 'delete_subject', 'edit', 'add'); $stats_actions = array('index', 'teacher_stats', 'student_stats', 'teacher_stats_details', 'student_stats_details', 'get_student_subjects', 'view'); $student_actions = array('my_subjects'); if (array_search($this->params['action'], $administrator_actions) !== false && $this->Auth->user('type') != "Administrador") { return false; } if (array_search($this->params['action'], $stats_actions) !== false && ($this->Auth->user('type') == "Estudiante" || $this->Auth->user('type') == "Conserje")) { return false; } if (array_search($this->params['action'], $administrative_actions) !== false && $this->Auth->user('type') != "Administrador" && $this->Auth->user('type') != "Administrativo") { return false; } if (array_search($this->params['action'], $student_actions) !== false && $this->Auth->user('type') != "Estudiante") { return false; } return true; }
function _authorize() { parent::_authorize(); $this->set('bookings_schedule', true); if ($this->params['action'] == "get" || $this->params['action'] == "view") { return true; } if ($this->Auth->user('type') != "Administrador" && $this->Auth->user('type') != "Conserje") { return false; } return true; }