notification::security::can_admin_request_p (public)

 notification::security::can_admin_request_p [ -user_id user_id ] \
    -request_id request_id

Defined in packages/notifications/tcl/notifications-security-procs.tcl

Checks if a user can manage a given notification request.

Switches:
-user_id (optional)
-request_id (required)
Returns:
boolean value

Partial Call Graph (max 5 caller/called nodes):
%3 notification::security::require_admin_request notification::security::require_admin_request (public) notification::security::can_admin_request_p notification::security::can_admin_request_p notification::security::require_admin_request->notification::security::can_admin_request_p acs_user::site_wide_admin_p acs_user::site_wide_admin_p (public) notification::security::can_admin_request_p->acs_user::site_wide_admin_p ad_conn ad_conn (public) notification::security::can_admin_request_p->ad_conn db_0or1row db_0or1row (public) notification::security::can_admin_request_p->db_0or1row

Testcases:
No testcase defined.
Source code:
        # owner of notification or side-wide admin
        set allowed 0
        if {$user_id eq ""} {
            set user_id [ad_conn user_id]
        }
        if {[acs_user::site_wide_admin_p -user_id $user_id]} {
            set allowed 1
        } else {
            set allowed [db_0or1row check_owner {
                select 1 from notification_requests
                where request_id = :request_id
                  and user_id = :user_id
            }]
        }
        return $allowed
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: