/** * Injector for the acl, the acl can be injected either directly * via this method or by passing the 'acl' option to the models * construct. * * We add all the access rule for this resource here, so we * add $this as the resource, plus its rules. * * @param SF_Acl_Interface $acl * @return SF_Model_Abstract */ public function setAcl(SF_Acl_Interface $acl) { if (!$acl->has($this->getResourceId())) { $acl->add($this)->allow('Admin', $this); } $this->_acl = $acl; return $this; }
/** * Injector for the acl, the acl can be injected either directly * via this method or by passing the 'acl' option to the models * construct. * * We add all the access rule for this resource here, so we * add $this as the resource, plus its rules. * * @param SF_Acl_Interface $acl * @return SF_Model_Abstract */ public function setAcl(SF_Acl_Interface $acl) { if (!$acl->has($this->getResourceId())) { $acl->add($this)->allow('Guest', $this, array('register'))->allow('Customer', $this, array('saveUser'))->allow('Admin', $this); } $this->_acl = $acl; return $this; }