<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check(self, user, permission, obj=_nothing):
 """Raises AuthorizationError when a user has no permission. :param user: a user. :param permission: permission to check. :param obj: (optional) an object to check permission for. """

        if not self.allows(user, permission, obj):
            raise AuthorizationError(
                'Can\'t {} object of class {}'.format(
                    permission, type(obj)))