PHP code example of friendsofcake / authorize

1. Go to this page and download the library: Download friendsofcake/authorize library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

friendsofcake / authorize example snippets


    //in $components
    public $components = array(
        'Auth' => array(
            'authorize' => array(
                'Controller',
                'Authorize.Acl' => array('actionPath' => 'Models/')
            )
        )
    );
    //Or in beforeFilter()
    $this->Auth->authorize = array(
        'Controller',
        'Authorize.Acl' => array('actionPath' => 'Models/')
    );

Configure::write('Acl.classname', 'Authorize.HabtmDbAcl');

    //in $components
    public $components = array(
        'Acl' => array('habtm' => array(
            'userModel' => 'Users.User',
            'groupAlias' => 'Group'
        )),
        'Auth' => array(
            //your Auth settings
        )
    );