Show
Ignore:
Timestamp:
03/24/08 17:06:55 (10 months ago)
Author:
aarkerio
Message:

Update permission by individual controller rather than general

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/colleges_controller.php

    r274 r339  
    33    *  Karamelo E-Learning Platform 
    44    *  Manuel Montoya 2002-2008  
    5     *  GPL License manuel<at>mononeurona<punto>org 
     5    *  GPLv3 License manuel<at>mononeurona<punto>org 
    66    *  Chipotle Software TM 
    77*/  
     
    1515 public $components       = array('Portal'); 
    1616 
     17 public function beforeFilter()  
     18 { 
     19    $this->Auth->allow(array('view')); 
     20    parent::beforeFilter(); 
     21 } 
     22  
    1723 public function isAuthorized()  
    18  { 
    19     if ($this->action == 'delete')  
    20       { 
    21     if ($this->Auth->user('group_id') == 1)  
    22           { 
     24 {       
     25    if (isset( $this->params[Configure::read('Routing.admin')] ))  
     26    { 
     27        if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 )  // admin and teachers 
     28        { 
    2329        return true; 
    24           } else { 
    25         return false; 
    26           } 
    27       } 
    28   
    29     return true; 
     30        }  
     31    }  
     32    return false;  // go away !! 
    3033 } 
     34 
    3135 
    3236 public function view()