Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

SPWidgetAccessControl- Global

The SPWidgetAccessControl script include provides methods that allow administrators to check whether a provided table is granted public access to a widget and is securely accessed by an intended audience.

For details and instructions about using the SPWidgetAccessControl API in your server script, see Configure widget security (Restrict which tables public widgets can access for guest users).

Parent Topic:Server API reference

SPWidgetAccessControl – SPWidgetAccessControl()

Instantiates the SPWidgetAccessControl object.

NameTypeDescription
None 

The following example shows how to initialize a new SPWidgetAccessControl object.

new global.SPWidgetAccessControl()

SPWidgetAccessControl – hasPublicAccess(String tableName, Object SPScriptable, String options, Object input)

Returns information about whether a specified table has public access to a widget.

NameTypeDescription
tableNameStringRequired. Name of the table to query. For example, enter `incident` to query the Incident \[Incident\] table.
SPScriptableScriptable ObjectRequired. Widget's SP Scriptable. Formatted as `$sp` in the request.
SPScriptable:{
"widgetSysId":widget sys_id,
"request":request object
}
optionsObjectOptional. Widget/rectangle options passed in the widget.
"options":{
"table":"incident", "maximum_entries": "10"
}
inputObjectOptional. Widget/rectangle input passed during runtime.
"input":{
"table":"incident", 
"display_field":"name"
}
TypeDescription
BooleanFlag that indicates the widget access status of the specified table. Possible values:- true: The provided table is granted security access on the widget. - false: The provided table is not granted security access on the widget. Default: false

The following example shows confirmation that the Incident table has access to the Simple List Widget as shown in the configuration table, m2m_sp_public_widget_allow_table.

options.table = "incident";
//$sp,options,input - which are available by default in any widget script
new global.SPWidgetAccessControl().hasPublicAccess(options.table, $sp, options, input);

Output:

true