Cakephp 1.3, router and authentication problem

Posted by Zhlobopotam on Stack Overflow See other posts from Stack Overflow or by Zhlobopotam
Published on 2010-03-30T22:33:39Z Indexed on 2010/03/31 8:13 UTC
Read the original article Hit count: 286

Filed under:
|
|
|
|

Trying to implements simple privileges for admin user. Don't need huge acl rules and groups system. There are admin users, overs - just registered users. They can't access actions with admin prefix. So It was implemented in cakephp1.2 version with following code in app_controller:

function isAuthorized() {
    if (isset($this->params[Configure::read('Routing.admin')])) {
    if ($this->Auth->user('admin') != 1) {
        return false;
    }
    }
    return true;
}

But in 1.3 Routing.admin had been deprecated. How to rewrite it for use with 1.3 framework? Need some help.

© Stack Overflow or respective owner

Related posts about php

Related posts about cakephp