group::member_p (public)
group::member_p [ -user_id user_id ] [ -group_name group_name ] \ [ -group_id group_id ] [ -subsite_id subsite_id ] [ -cascade ]
Defined in packages/acs-subsite/tcl/group-procs.tcl
Return 1 if the user is a member of the group specified. You can specify a group name or group id. If there is more than one group with this name, it will use the first one. If cascade is true, check to see if the user is a member of the group by virtue of any other component group. (e.g. if group B is a component of group A then if a user is a member of group B then he is automatically a member of A also.) If cascade is false, then the user must have specifically been granted membership on the group in question.
- Switches:
- -user_id (optional)
- -group_name (optional)
- -group_id (optional)
- -subsite_id (optional)
- Only useful when using group_name. Marks the subsite in which to search for the group_id that belongs to the group_name
- -cascade (optional, boolean)
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- acs_subsite_check_composite_group
Source code: if { $user_id eq "" } { set user_id [ad_conn user_id] } if { $group_name eq "" && $group_id eq "" } { ad_log warning "group::member_p: neither group_name nor group_id was provided; returning 0" return 0 } if { $group_name ne "" } { set group_id [group::get_id -group_name $group_name -subsite_id $subsite_id] if { $group_id eq "" } { ad_log warning "group::member_p: could not lookup '$group_name' (for subsite_id '$subsite_id'); returning 0" return 0 } } return [acs::group_cache eval -partition_key $group_id member-$group_id-$user_id-$cascade_p { group::member_p_not_cached -group_id $group_id -user_id $user_id -cascade_p $cascade_p }] #return [util_memoize [list group::member_p_not_cached -group_id $group_id -user_id $user_id -cascade_p $cascade_p]]XQL Not present: Generic PostgreSQL XQL file: packages/acs-subsite/tcl/group-procs-postgresql.xql
Oracle XQL file: packages/acs-subsite/tcl/group-procs-oracle.xql