(domain, new_plan_version)
return True
Perform Role Based Access Downgrade
        - Archive custom roles.
        - Set user roles using custom roles to Read Only.
        - Reset initial roles to standard permissions.
Perform Role Based Access Downgrade
        - Archive custom roles.
        - Set user roles using custom roles to Read Only.
        - Reset initial roles to standard permissions.
Perform Role Based Access Downgrade - Archive custom roles . - Set user roles using custom roles to Read Only . - Reset initial roles to standard permissions .
def response_role_based_access(domain, new_plan_version):
        """
        Perform Role Based Access Downgrade
        - Archive custom roles.
        - Set user roles using custom roles to Read Only.
        - Reset initial roles to standard permissions.
        """
        custom_roles = get_custom_roles_for_domain(domain.name)
        from corehq.apps.accounting.models import SoftwarePlanEdition
        if not custom_roles or (new_plan_version.plan.edition == SoftwarePlanEdition.PAUSED):
            return True
        archive_custom_roles_for_domain(domain.name)
        reset_initial_roles_for_domain(domain.name)
        return True
def response_role_based_access ( domain , new_plan_version ) : custom_roles = get_custom_roles_for_domain ( domain . name ) from corehq . apps . accounting . models import SoftwarePlanEdition if not custom_roles or ( new_plan_version . plan . edition == SoftwarePlanEdition . PAUSED ) : return True archive_custom_roles_for_domain ( domain . name ) reset_initial_roles_for_domain ( domain . name ) return True