src/Rbac/DbManager.php
public function getPermissionsByUser($userId)
    {
        if ($this->isEmptyUserId($userId)) {
            return resolve([]);
        }

        $promises = [
            $this->getDirectPermissionsByUser($userId)->otherwise(function() { return []; }),
            $this->getInheritedPermissionsByUser($userId)->otherwise(function() { return []; }),
        ];
        return all($promises)
            ->then(function($results) {
                return array_merge(...$results);
            });
    }
public function getPermissionsByUser($userId)
    {
        if ($this->isEmptyUserId($userId)) {
            return resolve([]);
        }

        $promises = [
            $this->getDirectPermissionsByUser($userId)->otherwise(function() { return []; }),
            $this->getInheritedPermissionsByUser($userId)->otherwise(function() { return []; }),
        ];
        return all($promises)
            ->then(function($results) {
                return array_merge(...$results);
            });
    }
{@inheritdoc}