本文整理汇总了PHP中AppController::_authorize方法的典型用法代码示例。如果您正苦于以下问题:PHP AppController::_authorize方法的具体用法?PHP AppController::_authorize怎么用?PHP AppController::_authorize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppController
的用法示例。
在下文中一共展示了AppController::_authorize方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function _authorize()
{
parent::_authorize();
if ($this->Auth->user('type') != "Estudiante" && $this->Auth->user('type') == "Becario") {
return false;
}
return true;
}
示例2: array
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;
}
示例3: array
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;
}
示例4: array
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;
}
示例5: array
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;
}
示例6: array
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;
}
示例7: array
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;
}
示例8:
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;
}