group::party_member_p (public)
group::party_member_p [ -party_id party_id ] [ -group_id group_id ] \ [ -group_name group_name ] [ -subsite_id subsite_id ]
Defined in packages/acs-subsite/tcl/group-procs.tcl
Return 1 if the party is an approved member of the group specified. One can specify a group_id (preferred) or a group name. Note: The group name is not unique by definition, and if you call this function with a duplicate group name it will return the first one (arbitrary)!!! Using the group name as a parameter is thus strongly discouraged unless you are really, really sure the name is unique.
The party must have specifically been granted membership on the group in question.
- Switches:
- -party_id (optional)
- -group_id (optional)
- -group_name (optional)
- -subsite_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- subsite_api
Source code: if { $group_name ne "" } { if {$group_id ne ""} { ad_log warning "group::party_member_p: ignore specified group_id $group_id, using name '$group_name' instead" } set group_id [group::get_id -group_name $group_name -subsite_id $subsite_id] } if { $group_id eq "" } { set result 0 } else { # Limiting to one row is required for those groups that define # relational segments (e.g. subsites, as for admins two rows # will be there for both their roles of member and # administrator). set result [db_0or1row party_is_member { select 1 from dual where exists (select 1 from group_approved_member_map where member_id = :party_id and group_id = :group_id) }] } return $resultXQL 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