Sample: Filter Users by SiteRole
In this example, all unlicensed users are excluded from migration.
Filter Class
from tableau_migration import (
IUser,
ContentMigrationItem,
ContentFilterBase,
SiteRoles)
class UnlicensedUserFilter(ContentFilterBase[IUser]):
def should_migrate(self, item: ContentMigrationItem[IUser]) -> bool:
if item.source_item.license_level.casefold() == SiteRoles.UNLICENSED.casefold():
return False
return True
Registration
plan_builder.filters.add(UnlicensedUserFilter)
See hook registration for more details.