[FIX] website_forum: do not check if the user has the group comment

This access rights checks is meaningful for website_blog only
This commit is contained in:
Denis Ledoux 2014-05-26 11:49:26 +02:00
parent 2a2f7af62e
commit 1e84f72899
1 changed files with 6 additions and 7 deletions

View File

@ -329,13 +329,12 @@ class WebsiteForum(http.Controller):
cr, uid, context = request.cr, request.uid, request.context
if kwargs.get('comment') and post.forum_id.id == forum.id:
# TDE FIXME: check that post_id is the question or one of its answers
if request.registry['res.users'].has_group(cr, uid, 'website_mail.group_comment'):
request.registry['forum.post'].message_post(
cr, uid, post.id,
body=kwargs.get('comment'),
type='comment',
subtype='mt_comment',
context=dict(context, mail_create_nosubcribe=True))
request.registry['forum.post'].message_post(
cr, uid, post.id,
body=kwargs.get('comment'),
type='comment',
subtype='mt_comment',
context=dict(context, mail_create_nosubcribe=True))
return werkzeug.utils.redirect("/forum/%s/question/%s" % (slug(forum), slug(question)))
@http.route('/forum/<model("forum.forum"):forum>/post/<model("forum.post"):post>/toggle_correct', type='json', auth="public", website=True)