public function buildAcl()
    {
        if ($this->builded) {
            return $this;
        }
        $config = $this->getConfig();
        $this->buildCommonRoles()->deny(self::ROLE_PUBLIC);
        foreach ($config['controller'] as $controller => $roles) {
            $this->addResource($controller);
            $this->allows($roles, $controller);
        }
        foreach ($config['action'] as $controller => $actions) {
            foreach ($actions as $action => $roles) {
                $resource = $this->buildResource($controller, $action);
                if (!$roles) {
                    $this->addResource($resource, $controller);
                } else {
                    $this->addResource($resource);
                }
                $this->allows($roles, $resource);
            }
        }
        foreach ($config['admin'] as $admin) {
            if (!$this->hasRole($admin)) {
                $this->addRole($admin, [self::ROLE_ADMIN, self::ROLE_LOGGED, self::ROLE_PUBLIC]);
            }
            $this->allow($admin);
        }
        
        $this->builded = true;
        return $this;
    }