views:

32

answers:

2

Hi, im making an application and i need to implement diferent level of user permits.

I coul have the function

$this->view->users->hasPermits($this->view->user);

By declaring a function on the model, an things could be easy to implement. But i would like to be able to have the next function doing the same:

$this->view->user->hasPermits();

Is there a way to do this? do i need to extend the Zend_Db_Table_Row class? any ideas?

+1  A: 

Use Zend_Acl for this.

There is a Zend ACL tutorial on YouTube.

takeshin
+1  A: 

If $user is a Zend_Db_Table_Row from the Zend_Db_Table $users, than in User you could perform the method like so:

public function hasPermits()
{
    return $this->getTable()->hasPermits($this);
}
smack0007