Although it is possible to remove forum posting rights using roles in Moodle I needed a quick way to ban posting rights for a particular user and forum.
We use Moodle as a student intranet as well as a VLE. On the student intranet we have a student forum where students can discuss almost anything. Occasionally, some students abuse this and post inappropriate messages. We required a way to ban re-offenders from posting to the student intranet forum but retain their posting rights for their course forums.
I made some changes to the mdl_user table in the database and added a field called forum_rights.
This field is an integer. Then i made some core changes to the Moodle code so that when a forum loads it checks the course ID against the user ID and if the user is banned they can read the entries in the forum but can no longer post.
When a banned user tries to post an error box appears informing them of the ban.