# HG changeset patch # User gibus # Date 1307347690 -7200 # Node ID c926868cf7e6babf766249104ac5420ca721adf1 # Parent 4c7feb67d4a0f83dd08aa164ffda889e0d193623 if DECORATED_CREATORS take into account the "fake" username if has_own_perm() diff -r 4c7feb67d4a0 -r c926868cf7e6 src/cm/converters/pandoc_converters.py --- a/src/cm/converters/pandoc_converters.py Tue May 31 18:26:38 2011 +0200 +++ b/src/cm/converters/pandoc_converters.py Mon Jun 06 10:08:10 2011 +0200 @@ -15,7 +15,7 @@ import re PANDOC_BIN = "pandoc" -PANDOC_OPTIONS = " --sanitize-html --email-obfuscation=none " +PANDOC_OPTIONS = " --sanitize-html --email-obfuscation=none " PANDOC_OPTIONS_RAW = " -R --email-obfuscation=none " MARKDOWN2PDF_BIN = "markdown2pdf" @@ -202,7 +202,7 @@ stdoutdata = re.sub(r"(\/?)>", r"\n\1>", stdoutdata) # do not split closing tag with following opening tag stdoutdata = re.sub(r">\n<", r"><", stdoutdata) - # nest headers tags + # nest headers tags #stdoutdata = re.sub(r'', r'
', stdoutdata) #stdoutdata = re.sub(r'<\/h(\d)\n>', r'
', stdoutdata) return stdoutdata diff -r 4c7feb67d4a0 -r c926868cf7e6 src/cm/security.py --- a/src/cm/security.py Tue May 31 18:26:38 2011 +0200 +++ b/src/cm/security.py Mon Jun 06 10:08:10 2011 +0200 @@ -98,7 +98,15 @@ not has_perm(request, 'can_manage_text', text=text): return False - return (comment.user == request.user and has_perm(request, perm_name, text=text)) + actual_own_user = False + from cm.cm_settings import DECORATED_CREATORS + if comment.user == request.user: + if DECORATED_CREATORS: + if request.GET.get('name', None) == comment.get_name(): + actual_own_user = True + else: + actual_own_user = True + return (actual_own_user and has_perm(request, perm_name, text=text)) def is_authenticated(request): # We customize this to be able to monkey patch it if needed