Modify

Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#36 closed defect (fixed)

Small Fix to AddComment.py to enable anonymous comments

Reported by: lalee_net@… Owned by: Alec Thomas
Priority: normal Component: AddCommentMacro
Severity: minor Keywords:
Cc: Trac Release:

Description

With Revision 61, the GUI widgets are disabled if the user doesn't have Modify rights. This quick fix re-enables the widgets to allow anonymous comments, without giving "Site Admin" access.

--- AddComment.oob Fri Aug 12 13:20:19 2005 +++ AddComment.py Fri Aug 12 13:20:41 2005 @@ -47,7 +47,8 @@ def execute(hdf, args, env):

comment = re.sub('(|[!])(\[\[AddComment)', '
1\\2', comment)

out = StringIO()

  • if wikipreview or not perm.has_permission('WIKI_MODIFY'):

+ + if wikipreview or not (perm.has_permission('WIKI_MODIFY') or appendonly):

disabled = ' disabled="disabled"'

# If we are submitting or previewing, inject comment as it should look

Attachments (0)

Change History (2)

comment:1 Changed 12 years ago by anonymous

D'oh.. let's try that again...

--- AddComment.oob      Fri Aug 12 13:20:19 2005
+++ AddComment.py       Fri Aug 12 13:20:41 2005
@@ -47,7 +47,8 @@ def execute(hdf, args, env):
     comment = re.sub('(^|[^!])(\[\[AddComment)', '\\1!\\2', comment)
 
     out = StringIO()
-    if wikipreview or not perm.has_permission('WIKI_MODIFY'):
+
+    if wikipreview or not (perm.has_permission('WIKI_MODIFY') or appendonly):
         disabled = ' disabled="disabled"'
 
     # If we are submitting or previewing, inject comment as it should look

comment:2 Changed 12 years ago by Alec Thomas

Resolution: fixed
Status: newclosed

(In [112])

  • appendonly now works even if the anonymous user does not have WIKI_MODIFY permissions. Closes #36

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Alec Thomas.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.