<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def permission_delete_link(context, perm):
 """ Renders a html link to the delete view of the given permission. Returns no content if the request-user has no permission to delete foreign permissions. """

    user = context['request'].user
    if user.is_authenticated():
        if (user.has_perm('authority.delete_foreign_permissions') or
                user.pk == perm.creator.pk):
            return base_link(context, perm, 'authority-delete-permission')
    return {'url': None}