id	summary	reporter	owner	description	type	status	priority	component	severity	resolution	keywords	cc	release
10281	DISCUSSION_ATTACH perm needed to be able to view an attachment	sdegrande	rjollos	I would suggest that DISCUSSION_VIEW should be enough to be granted to view the attachments of a topic.\r\n\r\nCurrently, DISCUSSION_ATTACH perm is needed, and as far as I understand, that perm is rather intended to grant the actual attachment of a file to a topic.\r\n\r\nHere is a small patch to change the current behavior:\r\n{{{\r\n#!diff\r\ndiff -r ec2c58e517b9 discussionplugin/0.11/tracdiscussion/api.py\r\n--- a/discussionplugin/0.11/tracdiscussion/api.py_Sat Aug 11 22:09:49 2012 +0000\r\n+++ b/discussionplugin/0.11/tracdiscussion/api.py_Wed Sep 05 15:18:59 2012 +0200\r\n@@ -155,9 +155,10 @@\r\n \r\n     def check_attachment_permission(self, action, username, resource, perm):\r\n         if resource.parent.realm == 'discussion':\r\n-            if action in ['ATTACHMENT_VIEW', 'ATTACHMENT_CREATE',\r\n-              'ATTACHMENT_DELETE']:\r\n+            if action in ['ATTACHMENT_CREATE', 'ATTACHMENT_DELETE']:\r\n                 return 'DISCUSSION_ATTACH' in perm(resource.parent)\r\n+            elif action in ['ATTACHMENT_VIEW']:\r\n+                return 'DISCUSSION_VIEW' in perm(resource.parent) \r\n \r\n     # IResourceManager methods.\r\n}}}\r\n\r\n\r\nThanks for your great work !	defect	closed	normal	DiscussionPlugin	normal	fixed			1.0
