nsmcp::ToolRegistry method list (public)

 <instance of nsmcp::ToolRegistry[i]> list context authorizer

Defined in /usr/local/ns/tcl/nsmcp/01-tools.tcl

List the tools available to an authenticated caller. Refresh providers and apply administrative enable flags and the supplied authorizer.

Parameters:
context (required)
Authenticated request context carrying the principal, grants and selected server.
authorizer (required)
Authorizer used to enforce the request context's permissions and targets.
Returns:
A rooted JSON object containing the tools array.

Testcases:
No testcase defined.
Source code:
:refreshProviders
set result {}
foreach name [lsort [dict keys ${:tools}]] {
    set tool [dict get ${:tools} $name]
    if {[:readEnabled $name] && [$authorizer allowed $context [$tool permission]]} {
        if {[$context cget -questionRestricted]} {
            if {![dict exists [$context cget -questionPins] $name]} {
                continue
            }
            :verifyQuestionPin $context $name
        }
        lappend result [$tool describe]
    }
}
set members {}
set index 0
foreach description $result {
    lappend members $index object [lindex $description 2]
    incr index
}
return [list {} object [list tools array $members]]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: