@classmethod<EOL><INDENT>def remove_role_from_user(cls, user):<DEDENT>
<EOL>current_adjusted_true_permissions = cls._get_adjusted_true_permissions(user)<EOL>group, _created = cls.get_or_create_group()<EOL>user.groups.remove(group)<EOL>new_adjusted_true_permissions = cls._get_adjusted_true_permissions(user)<EOL>permissions_to_remove = (current_adjusted_true_permissions<EOL>.difference(new_adjusted_true_permissions))<EOL>for permission in permissions_to_remove:<EOL><INDENT>user.user_permissions.remove(permission)<EOL><DEDENT>return group<EOL>
Remove this role from a user.

WARNING: Any permissions that were explicitly granted to the user
that are also defined to be granted by this role will be revoked
when this role is revoked.

Example:
    >>> class Doctor(AbstractUserRole):
    ...     available_permissions = {
    ...         "operate": False,
    ...     }
    >>>
    >>> class Surgeon(AbstractUserRole):
    ...     available_permissions = {
    ...         "operate": True,
    ...     }
    >>>
    >>> grant_permission(user, "operate")
    >>> remove_role(user, Surgeon)
    >>>
    >>> has_permission(user, "operate")
    False
    >>>

In the example, the user no longer has the ``"operate"`` permission,
even though it was set explicitly before the ``Surgeon`` role was removed.