class Application_Model_Acl_Acl extends Zend_Acl
{ 
    public function __construct() {
        //Var Declaration
        $array = array();
        $exploded = null;
        $count = null;
        //Users Distribution
        $role = new Application_Model_DbTable_Role();
        $rsRole = $role->fetchAll();
        //Role Distribution
        foreach($rsRole as $rRole) {
          $this->addRole(new Zend_Acl_Role($rRole->role));
        }
        //Resource Distribution
        $resource = new Application_Model_DbTable_Resource();
        $rsResource = $resource->fetchAll();
        foreach($rsResource as $rResource) {
            $this->add(new Zend_Acl_Resource($rResource->resource));
        }
        //Acces Distribution
        $allows = new Application_Model_DbTable_Allow();
        $rsAllows = $allows->fetchAll();
        if($rsAllows) {
            foreach($rsAllows as $rAllows) {
                $array = explode(',', $rAllows->acl_resources_id);
                $count = count($array);
                for($i = 0 ; $i < $count ; $i++) {
                     $this->allow($role->getRole($rAllows->acl_roles_id),
$resource->getResource($array[$i]));
                }
            }
        }
    }
}

-----
wenn du nicht für etwas zu tun stehst, wirst du für alles fallen
--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Db-Backend-for-Zend-Acl-tp3515700p3584406.html
Sent from the Zend Framework mailing list archive at Nabble.com.

--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to