Пример #1
0
 /**
  * Test case
  */
 public function testTestLocalAdminsShouldHaveAllPrivileges()
 {
     $role = 'local_admins';
     $resource = 'debug_test';
     $this->assertTrue($this->acl->isAllowed($role, $resource, 'create'));
     $this->assertTrue($this->acl->isAllowed($role, $resource, 'read'));
     $this->assertTrue($this->acl->isAllowed($role, $resource, 'update'));
     $this->assertTrue($this->acl->isAllowed($role, $resource, 'delete'));
 }
Пример #2
0
    /**
     * Initiate Shopware ACL Component (inherits from zend_acl)
     *
     * @return Shopware_Components_Acl
     */
    public function onInitResourceAcl()
    {
        if(!Shopware()->Bootstrap()->issetResource('Db')) {
            return null;
        }

        $acl = new Shopware_Components_Acl();
        $acl->initShopwareAclTree(Shopware()->Db());

        return $acl;
    }