src/Rbac/DbManager.php
public function getAssignment($roleName, $userId)
    {
        if ($this->isEmptyUserId($userId)) {
            return reject(new Error("User id is empty"));
        }

        return (new Query())->from($this->assignmentTable)
            ->where(['user_id' => (string)$userId, 'item_name' => $roleName])
            ->one($this->db)
            ->then(
                function($row) {
                    return new Assignment([
                        'userId' => $row['user_id'],
                        'roleName' => $row['item_name'],
                        'createdAt' => $row['created_at'],
                    ]);
                },
                function() use ($userId, $roleName) {
                    throw new Error("No assignment found for user '$userId' and role '$roleName'");
                }
            );
    }
public function getAssignment($roleName, $userId)
    {
        if ($this->isEmptyUserId($userId)) {
            return reject(new Error("User id is empty"));
        }

        return (new Query())->from($this->assignmentTable)
            ->where(['user_id' => (string)$userId, 'item_name' => $roleName])
            ->one($this->db)
            ->then(
                function($row) {
                    return new Assignment([
                        'userId' => $row['user_id'],
                        'roleName' => $row['item_name'],
                        'createdAt' => $row['created_at'],
                    ]);
                },
                function() use ($userId, $roleName) {
                    throw new Error("No assignment found for user '$userId' and role '$roleName'");
                }
            );
    }
{@inheritdoc}