<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def attachment_delete_link(context, attachment):
 """ Renders a html link to the delete view of the given attachment. Returns no content if the request-user has no permission to delete attachments. The user must own either the ``attachments.delete_attachment`` permission and is the creator of the attachment, that he can delete it or he has ``attachments.delete_foreign_attachments`` which allows him to delete all attachments. """

    if context['user'].has_perm('attachments.delete_foreign_attachments') or (
        context['user'] == attachment.creator
        and context['user'].has_perm('attachments.delete_attachment')
    ):
        return {
            'next': context.request.build_absolute_uri(),
            'delete_url': reverse(
                'attachments:delete', kwargs={'attachment_pk': attachment.pk}
            ),
        }
    return {'delete_url': None}