Uploaded image for project: 'COmanage'
  1. COmanage
  2. CO-245

authorization handler in AppController method should be array not string

    XMLWordPrintable

Details

    Description

      In Controller/AppController.php the beforeFilter() method for the AppController class is where we are configuring authorization handlers. Prior to CakePHP 2.0.x the handler was configured as

      $this->Auth->authorize = 'controller';

      With the change to CakePHP 2.0.x this needs to be

      $this->Auth->authorize = array('Controller');

      The configuration of authorization handlers is detailed in the CakePHP 2.0.x documentation at

      http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html

      in the section 'Configuring Authorization handlers'.

      Specifically it says

      You can configure authorization handlers in your controller's beforeFilter or, in the $components array. You can pass configuration information into each authorization object, using an array:

      <?php
      // Basic setup
      $this->Auth->authorize = array('Controller');

      // Pass settings in
      $this->Auth->authorize = array(
      'Actions' => array('actionPath' => 'controllers/'),
      'Controller'
      );

      Attachments

        Activity

          People

            scott.koranda.3@at.internet2.edu Scott Koranda SCG (Inactive)
            scott.koranda.3@at.internet2.edu Scott Koranda SCG (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: