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):
%3 test_subsite_api subsite_api (test acs-subsite) group::party_member_p group::party_member_p test_subsite_api->group::party_member_p ad_log ad_log (public) group::party_member_p->ad_log db_0or1row db_0or1row (public) group::party_member_p->db_0or1row group::get_id group::get_id (public) group::party_member_p->group::get_id packages/acs-subsite/www/members/index.tcl packages/acs-subsite/ www/members/index.tcl packages/acs-subsite/www/members/index.tcl->group::party_member_p

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 $result
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

[ hide source ] | [ make this the default ]
Show another procedure: