2008年11月26日星期三

[fw-auth] Auth blocking from some pages but not others

When i am not logged in, I am unable to get in to the admin subdirectory,
I am able to access pages with simple urls such as /about and /gallery etc.
but if i'm trying to access something like /wedding/bouquets/frangipanis/1
then i am denied, and get the login page.
wierd.

this is the acl file

public function __construct(Zend_Auth $auth)
{
// Add Resources

// Resource #1: Default Module
$this->add(new Zend_Acl_Resource('default'));
// Resource #2: Admin Module
$this->add(new Zend_Acl_Resource('admin'));

// Add Roles

// Role #1: Guest
$this->addRole(new Zend_Acl_Role('guest'));
// Role #2: Author (inherits from Guest)
$this->addRole(new Zend_Acl_Role('author'), 'guest');

// Assign Access Rules

// Rule #1 & #2: Guests can access Default Module (Author inherits
this)
$this->allow('guest', 'default');
// Rule #3 & #4: Authors can access Admin Module (Guests denied by
default)
$this->allow('author', 'admin');
}


I have this in my bootstrap file

$frontController->setControllerDirectory(array(
'default' => APPLICATION_PATH . '/controllers',
'admin' => APPLICATION_PATH . '/admin/controllers'
)
and to set the route
$route = new Zend_Controller_Router_Route(
'wedding/bouquets/:bouquet',
array(
'controller' => 'wedding',
'action' => 'bouquet'
)
);

$router->addRoute('bouquets',$route);
$route2 = new Zend_Controller_Router_Route(
'bouquet/:bouquet/*',
array(
'controller' => 'bouquet',
'action' => 'bouquet'
)
);

$router->addRoute('bouquet',$route2);
$route3 = new Zend_Controller_Router_Route(
'wedding/bouquets/:bouquet/:page',
array(
'controller' => 'wedding',
'action' => 'bouquet'
)
);
$router->addRoute('bouquets',$route3);

What am I doing wrong here.
I thought I had worked the auth/acl out perfectly, until I came across these
sub pages.

Thanks for any help.

--
View this message in context: http://www.nabble.com/Auth-blocking-from-some-pages-but-not-others-tp20714091p20714091.html
Sent from the Zend Auth mailing list archive at Nabble.com.

没有评论: