当前位置: 首页>>代码示例>>PHP>>正文


PHP AppController::_authorize方法代码示例

本文整理汇总了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;
 }
开发者ID:recrea,项目名称:academic,代码行数:8,代码来源:registrations_controller.php

示例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;
 }
开发者ID:recrea,项目名称:academic,代码行数:10,代码来源:massive_attendance_registers_controller.php

示例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;
 }
开发者ID:recrea,项目名称:academic,代码行数:13,代码来源:attendance_registers_controller.php

示例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;
 }
开发者ID:recrea,项目名称:academic,代码行数:13,代码来源:events_controller.php

示例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;
 }
开发者ID:recrea,项目名称:academic,代码行数:10,代码来源:courses_controller.php

示例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;
 }
开发者ID:recrea,项目名称:academic,代码行数:17,代码来源:groups_controller.php

示例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;
 }
开发者ID:recrea,项目名称:academic,代码行数:22,代码来源:users_controller.php

示例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;
 }
开发者ID:recrea,项目名称:academic,代码行数:12,代码来源:bookings_controller.php


注:本文中的AppController::_authorize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。