import json
import os
from parable_types_web_api import SetSourcePermissionsInput
from parable_web_api_sdk import ClientConfig, WebApiSDK
sdk = WebApiSDK(
ClientConfig(
base_url=os.environ["PARABLE_API_URL"],
auth_token=os.environ["PARABLE_API_TOKEN"],
default_headers={"X-Tenant": os.environ["PARABLE_WORKSPACE"]},
)
)
input_data = SetSourcePermissionsInput.model_validate(
json.loads("{\"expectedRevision\":1,\"enforced\":true,\"linkOnlyGrantsAdmit\":true}"),
)
result = sdk.provider_policies.set_source_permissions(input_data)sdk, err := webapisdk.New(webapisdk.SDKConfig{
BaseURL: os.Getenv("PARABLE_API_URL"),
Auth: &webapisdk.AuthConfig{Token: os.Getenv("PARABLE_API_TOKEN")},
RequestInterceptor: func(ctx context.Context, req *http.Request) error {
req.Header.Set("X-Tenant", os.Getenv("PARABLE_WORKSPACE"))
return nil
},
})
if err != nil {
return err
}
var input webapitypes.SetSourcePermissionsInput
if err := json.Unmarshal([]byte(`{"expectedRevision":1,"enforced":true,"linkOnlyGrantsAdmit":true}`), &input); err != nil {
return err
}
result, err := sdk.ProviderPoliciesNamespace.SetSourcePermissions(ctx, input){
"data": {
"canManage": true,
"enforced": true,
"linkOnlyGrantsAdmit": true,
"managerReadSources": [
{
"connectorId": "<string>",
"name": "<string>",
"slug": "<string>"
}
],
"revision": 0,
"managerReads": {
"confirmedAt": "2023-11-07T05:31:56Z",
"confirmedBy": "<string>",
"connectorId": "<string>"
},
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>"
},
"meta": {
"requestId": "<string>",
"totalCount": 123
},
"links": {
"first": "<string>",
"last": "<string>",
"next": "<string>",
"prev": "<string>"
}
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Too Many Requests{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Set the Workspace's source permissions settings
Replaces the selected Workspace’s source permissions settings: whether source permissions are enforced, and whether link-only grants admit their audience. With enforcement on, a table a connector models, with no Provider Policy, reads only the rows each reader may open in the source. A table with no model still reads all rows. The save is refused unless expectedRevision is the current revision. A change is kept in the settings’ history and recorded in the audit trail with the person and the old and new values. A save that changes nothing records nothing.
import json
import os
from parable_types_web_api import SetSourcePermissionsInput
from parable_web_api_sdk import ClientConfig, WebApiSDK
sdk = WebApiSDK(
ClientConfig(
base_url=os.environ["PARABLE_API_URL"],
auth_token=os.environ["PARABLE_API_TOKEN"],
default_headers={"X-Tenant": os.environ["PARABLE_WORKSPACE"]},
)
)
input_data = SetSourcePermissionsInput.model_validate(
json.loads("{\"expectedRevision\":1,\"enforced\":true,\"linkOnlyGrantsAdmit\":true}"),
)
result = sdk.provider_policies.set_source_permissions(input_data)sdk, err := webapisdk.New(webapisdk.SDKConfig{
BaseURL: os.Getenv("PARABLE_API_URL"),
Auth: &webapisdk.AuthConfig{Token: os.Getenv("PARABLE_API_TOKEN")},
RequestInterceptor: func(ctx context.Context, req *http.Request) error {
req.Header.Set("X-Tenant", os.Getenv("PARABLE_WORKSPACE"))
return nil
},
})
if err != nil {
return err
}
var input webapitypes.SetSourcePermissionsInput
if err := json.Unmarshal([]byte(`{"expectedRevision":1,"enforced":true,"linkOnlyGrantsAdmit":true}`), &input); err != nil {
return err
}
result, err := sdk.ProviderPoliciesNamespace.SetSourcePermissions(ctx, input){
"data": {
"canManage": true,
"enforced": true,
"linkOnlyGrantsAdmit": true,
"managerReadSources": [
{
"connectorId": "<string>",
"name": "<string>",
"slug": "<string>"
}
],
"revision": 0,
"managerReads": {
"confirmedAt": "2023-11-07T05:31:56Z",
"confirmedBy": "<string>",
"connectorId": "<string>"
},
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>"
},
"meta": {
"requestId": "<string>",
"totalCount": 123
},
"links": {
"first": "<string>",
"last": "<string>",
"next": "<string>",
"prev": "<string>"
}
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Too Many Requests{
"detail": "<string>",
"status": 400,
"title": "Bad Request",
"type": "about:blank",
"code": "WA-VL-001",
"details": "<unknown>",
"errors": "<unknown>",
"requestId": "<string>"
}Access
This operation needs a Parable token. An MCP token cannot call it. See Authentication for the kinds of token. Your roles must granttenant.providerpolicies.manage.
Errors
WA-PP-009: Someone changed the Workspace’s source permissions settings after the revision the save names. Load the settings again and make the change on top of them.
Authorizations
A personal access token, which starts with pat_. A Parable token can call each operation that the roles of its owner allow. An MCP token can call only the read operations that are open to agents. A SQL token does not work on this API.
Headers
Workspace slug. Overrides subdomain-based workspace resolution when provided.
"acme"
Optional request correlation ID echoed back in the response.
"550e8400-e29b-41d4-a716-446655440000"
Body
Replaces a Workspace's source permissions settings. Both settings are required: a save that leaves one out is refused rather than turning it off.