forum::security::can_post_forum_p (public)

 forum::security::can_post_forum_p [ -user_id user_id ] \
    -forum_id forum_id

Defined in packages/forums/tcl/forums-security-procs.tcl

Switches:
-user_id (optional)
-forum_id (required)
Returns:
1 if the user can post in the forum, 0 otherwise.

Testcases:
web_forums_message_and_reply
Source code:
        set user_id [expr {$user_id eq "" ? [ad_conn user_id] : $user_id}]

        # Moderators can always post
        if { [permission::permission_p  -party_id  $user_id  -object_id $forum_id  -privilege "forum_moderate"] } {
            return true
        }

        forum::get -forum_id $forum_id -array forum

        # Others can post if forum is not closed. The public can post
        # only if anonymous posting is enabled.
        return [expr {$forum(posting_policy) ne "closed" &&
                      ($user_id != 0 || $forum(anonymous_allowed_p))}]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: