@register.inclusion_tag('authority/permission_delete_link.html', takes_context=True)
def permission_delete_link(context, perm):
 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}

@ register . inclusion_tag ( 'authority/permission_delete_link.html' , takes_context = True ) def permission_delete_link ( context , perm ) : 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 }
renders a html link to the delete view of the given permission .