validate_bboard_access

one of the documented procedures in this installation of the ACS
Usage:
validate_bboard_access   topic_id   read_access   user_id
What it does:
Return 1 if user has access to forum, otherwise return 0
Defined in: /web/philip/tcl/bboard-unified.tcl

Source code:



    set access_allowed 0

    # This mess is to try to avoid the subquery for the common case ("any" or "public" access)
    if { [string compare $read_access "any"] == 0 || 
         [string compare $read_access "public"] == 0 } {
	set access_allowed 1
    } else {
	set db_sub [ns_db gethandle subquery]
	if { ([string compare $read_access "group"] == 0 && 
	      [ad_permission_p $db_sub bboard $topic_id "" $user_id]) ||
	     [ad_administration_group_member $db_sub "site_wide" "" $user_id] } {
	    set access_allowed 1
	}
        ns_db releasehandle $db_sub
    }
    
    return $access_allowed


philg@mit.edu