public function loadDbAcl()
    {
        $db = \Zend_Registry::get('db');

        $sql = "SELECT grl_id_role, grl_name, grl_privileges, grl_parents FROM gems__roles";

        $roles = $db->fetchAll($sql);

        if (empty($roles)) {
            throw new \Exception("No roles stored in db");
        }

        // Set role id to name tranlations
        foreach ($roles as $role) {
            $this->_roleTranslations[$role['grl_id_role']] = $role['grl_name'];
        }
        $roleList = array_combine(array_map(function($value) { return $value['grl_name']; }, $roles), $roles);

        foreach ($roleList as $role) {
            $this->_expandRole($roleList, $role['grl_name']);
        }

        return true;
    }
public function loadDbAcl()
    {
        $db = \Zend_Registry::get('db');

        $sql = "SELECT grl_id_role, grl_name, grl_privileges, grl_parents FROM gems__roles";

        $roles = $db->fetchAll($sql);

        if (empty($roles)) {
            throw new \Exception("No roles stored in db");
        }

        // Set role id to name tranlations
        foreach ($roles as $role) {
            $this->_roleTranslations[$role['grl_id_role']] = $role['grl_name'];
        }
        $roleList = array_combine(array_map(function($value) { return $value['grl_name']; }, $roles), $roles);

        foreach ($roleList as $role) {
            $this->_expandRole($roleList, $role['grl_name']);
        }

        return true;
    }
public function loadDbAcl ( ) { $ db = \ Zend_Registry :: get ( 'db' ) ; $ sql = "SELECT grl_id_role, grl_name, grl_privileges, grl_parents FROM gems__roles" ; $ roles = $ db -> fetchAll ( $ sql ) ; if ( empty ( $ roles ) ) { throw new \ Exception ( "No roles stored in db" ) ; } // Set role id to name tranlations foreach ( $ roles as $ role ) { $ this -> _roleTranslations [ $ role [ 'grl_id_role' ] ] = $ role [ 'grl_name' ] ; } $ roleList = array_combine ( array_map ( function ( $ value ) { return $ value [ 'grl_name' ] ; } , $ roles ) , $ roles ) ; foreach ( $ roleList as $ role ) { $ this -> _expandRole ( $ roleList , $ role [ 'grl_name' ] ) ; } return true ; }
Load access control list from db
@throws \Exception
Load access control list from db