id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release
4959,inconsistent error handling,mkc,athomas,read-only pages do not raise a !TracError when there are insufficient privileges.  In the case of an unprivileged user_ they will see a grayed out form for readonly pages_ but an error for normal pages.\r\n\r\nOne of the following changes should make it consistent.  We opted for simply removing the !TracError because it seems more graceful to show the grayed out form rather than an error.\r\n\r\nFrom:\r\n{{{\r\n        if page.readonly:\r\n            if 'WIKI_ADMIN' in req.perm(resource):\r\n                cancomment = True\r\n        elif 'WIKI_MODIFY' in req.perm(resource):\r\n            cancomment = True\r\n        elif appendonly and 'WIKI_VIEW' in req.perm(resource):\r\n            cancomment = True\r\n        else:\r\n            raise TracError('Error: Insufficient privileges to AddComment')\r\n}}}\r\n\r\nTo:\r\n{{{\r\n        if page.readonly:\r\n            if 'WIKI_ADMIN' in req.perm(resource):\r\n                cancomment = True\r\n        elif 'WIKI_MODIFY' in req.perm(resource):\r\n            cancomment = True\r\n        elif appendonly and 'WIKI_VIEW' in req.perm(resource):\r\n            cancomment = True\r\n}}}\r\n\r\nOr:\r\n{{{\r\n        if page.readonly:\r\n            if 'WIKI_ADMIN' in req.perm(resource):\r\n                cancomment = True\r\n            else:\r\n                raise TracError('Error: Insufficient privileges to AddComment')\r\n        elif 'WIKI_MODIFY' in req.perm(resource):\r\n            cancomment = True\r\n        elif appendonly and 'WIKI_VIEW' in req.perm(resource):\r\n            cancomment = True\r\n        else:\r\n            raise TracError('Error: Insufficient privileges to AddComment')\r\n}}},defect,closed,normal,AddCommentMacro,normal,fixed,,,0.11
