public function getUserRoles($user, Content $content = null)
    {
        $userRoleNames = $user['roles'];
        if (!is_array($userRoleNames)) {
            throw new AccessControlException('Expected a user-like array, but the "roles" property is not an array');
        }
        $userRoleNames[] = self::ROLE_EVERYONE;
        if ($content && $content['user'] && $content['user']['id'] === $user['id']) {
            $userRoleNames[] = self::ROLE_OWNER;
        }
        $userRoleNames[] = self::ROLE_OWNER;

        $self = $this;

        return array_combine(
            $userRoleNames,
            array_map(
                function ($roleName) use ($self) {
                    return $self->getRole($roleName);
                },
                $userRoleNames
            )
        );
    }