application_group::contains_party_p (public)

 application_group::contains_party_p [ -package_id package_id ] \
    [ -party_id party_id ] [ -include_self ]

Defined in packages/acs-subsite/tcl/application-group-procs.tcl

Determines whether the party in question (identified by party_id) is contained by the application group identified by package_id. If package_id is not specified, and we have a connection, then the proc will grab the package_id of the current package (i.e., [ad_conn package_id]).

Switches:
-package_id (optional)
-party_id (optional)
-include_self (optional, boolean)

Partial Call Graph (max 5 caller/called nodes):
%3 test_subsite_api subsite_api (test acs-subsite) application_group::contains_party_p application_group::contains_party_p test_subsite_api->application_group::contains_party_p ad_conn ad_conn (public) application_group::contains_party_p->ad_conn db_string db_string (public) application_group::contains_party_p->db_string packages/acs-subsite/www/admin/groups/change-join-policy-2.tcl packages/acs-subsite/ www/admin/groups/change-join-policy-2.tcl packages/acs-subsite/www/admin/groups/change-join-policy-2.tcl->application_group::contains_party_p packages/acs-subsite/www/admin/groups/change-join-policy.tcl packages/acs-subsite/ www/admin/groups/change-join-policy.tcl packages/acs-subsite/www/admin/groups/change-join-policy.tcl->application_group::contains_party_p packages/acs-subsite/www/admin/groups/one.tcl packages/acs-subsite/ www/admin/groups/one.tcl packages/acs-subsite/www/admin/groups/one.tcl->application_group::contains_party_p packages/acs-subsite/www/admin/parties/one.tcl packages/acs-subsite/ www/admin/parties/one.tcl packages/acs-subsite/www/admin/parties/one.tcl->application_group::contains_party_p packages/acs-subsite/www/admin/rel-segments/new-2.tcl packages/acs-subsite/ www/admin/rel-segments/new-2.tcl packages/acs-subsite/www/admin/rel-segments/new-2.tcl->application_group::contains_party_p

Testcases:
subsite_api
Source code:

    if {$package_id eq "" && [ns_conn isconnected]} {
        set package_id [ad_conn package_id]
    }

    if {$package_id eq ""} {
        error "application_group::contains_party_p - package_id not specified"
    }

    # Check if the party is a member of the application group, OR
    # the party *is* the application group.  This proc considers the
    # application group to contain itself.
    if {$include_self_p} {
    set found_p [db_string app_group_contains_party_p {
        select case when exists (
            select 1
            from application_group_element_map
            where package_id = :package_id
              and element_id = :party_id
          union all
            select 1
            from application_groups
            where package_id = :package_id
              and group_id = :party_id
        ) then 1 else 0 end
        from dual
    }]
    } else {
    set found_p [db_string app_group_contains_party_p {
        select case when exists (
            select 1
            from application_group_element_map
            where package_id = :package_id
              and element_id = :party_id
        ) then 1 else 0 end
        from dual
    }]

    }

    return $found_p
XQL Not present:
Generic
PostgreSQL XQL file:
packages/acs-subsite/tcl/application-group-procs-postgresql.xql

Oracle XQL file:
packages/acs-subsite/tcl/application-group-procs-oracle.xql

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