permission::require_permission (public)

 permission::require_permission [ -party_id party_id ] \
    -object_id object_id -privilege privilege

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

require that party X have privilege Y on object Z

Switches:
-party_id
(optional)
-object_id
(required)
-privilege
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 Class ::Generic::Form Class ::Generic::Form (public) permission::require_permission permission::require_permission Class ::Generic::Form->permission::require_permission attachments::richtext::file_attach attachments::richtext::file_attach (public) attachments::richtext::file_attach->permission::require_permission download_file_downloader download_file_downloader (public) download_file_downloader->permission::require_permission packages/acs-core-docs/www/files/tutorial/note-edit.tcl packages/acs-core-docs/ www/files/tutorial/note-edit.tcl packages/acs-core-docs/www/files/tutorial/note-edit.tcl->permission::require_permission packages/acs-developer-support/www/set-user.tcl packages/acs-developer-support/ www/set-user.tcl packages/acs-developer-support/www/set-user.tcl->permission::require_permission ad_conn ad_conn (public) permission::require_permission->ad_conn ad_log ad_log (public) permission::require_permission->ad_log ad_return_forbidden ad_return_forbidden (public) permission::require_permission->ad_return_forbidden ad_script_abort ad_script_abort (public) permission::require_permission->ad_script_abort auth::require_login auth::require_login (public) permission::require_permission->auth::require_login

Testcases:
No testcase defined.
Source code:
    if {$party_id eq ""} {
        set party_id [ad_conn user_id]
    }

    if {![permission_p -party_id $party_id -object_id $object_id -privilege $privilege]} {

        if {!$party_id && ![ad_conn ajax_p]} {
            auth::require_login
        } else {
            set message [string cat "permission::require_permission: "  "$party_id doesn't have privilege $privilege "  "on object '$object_id'"]
            if {$object_id eq ""} {
                ad_log error $message
            } else {
                ns_log notice $message
            }
            ad_return_forbidden  "Permission Denied"  "You don't have permission to $privilege on object $object_id."
        }

        ad_script_abort
    }
Generic XQL file:
packages/acs-tcl/tcl/acs-permissions-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/acs-permissions-procs-postgresql.xql

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

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