edu_bboard_grant_access

one of the documented procedures in this installation of the ACS
Usage:
edu_bboard_grant_access   db   topic_id
What it does:
checks if a user is part of the group_id and has the role that is specified in the row containing the input topic_id in bboard_topics. returns 1 if the user has the correct role in the correct group; returns 0 otherwise
Defined in: /web/philip/tcl/education.tcl

Source code:


    set user_id [ad_verify_and_get_user_id $db]
    
    # assumes roles with lower priorities can take on roles with priorities
    # greater than or equal to its priority
    if {[database_to_tcl_string $db "
    select count(*) 
    from bboard_topics t, user_group_map ugm,
         edu_role_pretty_role_map user_role, 
         edu_role_pretty_role_map topic_role
    where ugm.user_id = $user_id
    and ugm.group_id=t.group_id
    and t.topic_id=$topic_id
    and ugm.role = user_role.role
    and topic_role.role=t.role(+)
    and user_role.priority<=topic_role.priority"]>0} {
	     return 1
	 } else {
	     return 0
	 }


philg@mit.edu