evan108108 / RESTFullYii

RESTFull API for your Yii application

Home Page:http://evan108108.github.com/RESTFullYii/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Access for guests

nicdnepr opened this issue · comments

Hi. How can i allow access for anonymous users? I added code

array('allow', 'actions'=>array('REST.GET', 'REST.PUT', 'REST.POST', 'REST.DELETE', 'REST.OPTIONS'),
'users'=>array('*'),
),

but it's not work.

@nicdnepr, @jossemarGT Just use the "post.filter.req.auth.user" to provide custom access using any logic that you would like:

$this->onRest('post.filter.req.auth.user', function($validation) {
    return $validation; //Bool
});

Thanks!