restrict deleting forum posts to janitors

This commit is contained in:
albert
2013-02-18 15:59:35 -05:00
parent b109d44daf
commit b8c0cbeed1
2 changed files with 32 additions and 30 deletions

View File

@@ -43,7 +43,7 @@ class ForumPostsController < ApplicationController
def destroy
@forum_post = ForumPost.find(params[:id])
check_privilege(@forum_post)
raise User::PrivilegeError unless CurrentUser.is_janitor?
@forum_post.update_attribute(:is_deleted, true)
respond_with(@forum_post)
end