Ejemplo n.º 1
0
 /**
  * Populate ACL with roles from external storage.
  *
  * @param Magento_Acl $acl
  */
 public function populateAcl(Magento_Acl $acl)
 {
     $roleList = $this->_roleResource->getRolesIds();
     foreach ($roleList as $roleId) {
         /** @var $aclRole Mage_Webapi_Model_Authorization_Role */
         $aclRole = $this->_roleFactory->createRole(array($roleId));
         $acl->addRole($aclRole);
         //Deny all privileges to Role. Some of them could be allowed later by whitelist
         $acl->deny($aclRole);
     }
 }
Ejemplo n.º 2
0
 public function testCreateRole()
 {
     $arguments = array('5', '6');
     $this->_objectManager->expects($this->once())->method('create')->with('Mage_Webapi_Model_Authorization_Role', $arguments, false)->will($this->returnValue($this->_expectedObject));
     $this->assertEquals($this->_expectedObject, $this->_model->createRole($arguments));
 }