subsite::assert_user_may_add_member (private)

 subsite::assert_user_may_add_member

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

Used on pages that add users to the application group of the current subsite to assert that the currently logged-in user may add users.

Author:
Peter Marklund

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-subsite/www/members/member-invite.tcl packages/acs-subsite/ www/members/member-invite.tcl subsite::assert_user_may_add_member subsite::assert_user_may_add_member packages/acs-subsite/www/members/member-invite.tcl->subsite::assert_user_may_add_member packages/acs-subsite/www/members/user-batch-add-2.tcl packages/acs-subsite/ www/members/user-batch-add-2.tcl packages/acs-subsite/www/members/user-batch-add-2.tcl->subsite::assert_user_may_add_member packages/acs-subsite/www/members/user-batch-add.tcl packages/acs-subsite/ www/members/user-batch-add.tcl packages/acs-subsite/www/members/user-batch-add.tcl->subsite::assert_user_may_add_member packages/acs-subsite/www/members/user-new.tcl packages/acs-subsite/ www/members/user-new.tcl packages/acs-subsite/www/members/user-new.tcl->subsite::assert_user_may_add_member ad_return_forbidden ad_return_forbidden (public) subsite::assert_user_may_add_member->ad_return_forbidden ad_script_abort ad_script_abort (public) subsite::assert_user_may_add_member->ad_script_abort application_group::group_id_from_package_id application_group::group_id_from_package_id (public) subsite::assert_user_may_add_member->application_group::group_id_from_package_id auth::require_login auth::require_login (public) subsite::assert_user_may_add_member->auth::require_login group::member_p group::member_p (public) subsite::assert_user_may_add_member->group::member_p

Testcases:
No testcase defined.
Source code:
    auth::require_login

    set group_id [application_group::group_id_from_package_id]

    set admin_p [permission::permission_p -object_id $group_id -privilege "admin"]

    if { !$admin_p } {
        # If not admin, user must be member of group, and members must be allowed to invite other members
        if { ![parameter::get -parameter "MembersCanInviteMembersP" -default 0]
             || ![group::member_p -group_id $group_id]
         } {
            ad_return_forbidden "Cannot invite members" "I'm sorry, but you're not allowed to invite members to this group"
            ad_script_abort
        }
    }
XQL Not present:
Generic
PostgreSQL XQL file:
packages/acs-subsite/tcl/subsite-procs-postgresql.xql

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

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