Piwik\Plugins\UsersManager\API::getUsersAccessFromSite PHP Method

getUsersAccessFromSite() public method

If a user doesn't have any access to the $idSite ('noaccess'), the user will not be in the returned array.
public getUsersAccessFromSite ( integer $idSite ) : array
$idSite integer website ID
return array The returned array has the format array( login1 => 'view', login2 => 'admin', login3 => 'view', ... )
    public function getUsersAccessFromSite($idSite)
    {
        Piwik::checkUserHasAdminAccess($idSite);
        $usersAccess = $this->model->getUsersAccessFromSite($idSite);
        $usersAccess = $this->userFilter->filterLoginIndexedArray($usersAccess);
        return $usersAccess;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @expectedException \Exception
  */
 public function testGetUsersAccessFromSiteWrongIdSite()
 {
     $this->api->getUsersAccessFromSite(1);
 }