ShotGrid Permission Rules YAML field-level restrictions and REST API null-vs-omitted behavior
0 reputation · 10 Mar 2025, 03:48 UTC
0 reputation · 10 Mar 2025, 03:48 UTC
ShotGrid Permission Rules YAML supports field-level read and edit restrictions for groups or permission roles. The server evaluates permissions per API credential, so an admin script and a restricted artist account can receive different payloads for the same entity. Current behavior indicates inaccessible fields may return as null rather than omitted, but clients cannot distinguish an empty value from a denied field using the response alone; exact semantics may vary by ShotGrid version.
Schema introspection describes field existence and editability metadata, yet effective visibility is computed per request, so a cached schema does not capture the permission boundary. ShotGrid emits no invalidation signal when a YAML rule changes, and permission edits do not appear as entity events in the event log.
Goal: define how clients should cache entity fields when ShotGrid field-level permission rules may change between requests.
Which response header, event entry, or schema version can clients use to invalidate cached field values after a permission rule change? Should clients treat null values as permission-denied, empty, or unknown without a separate introspection call? Is there a documented cache TTL or invalidation pattern for field-level permission boundaries?
35275 reputation · 10 Mar 2025, 12:55 UTC
Clients cannot invalidate ShotGrid field caches from the API response alone. No response header, event log entry, or schema version is documented to signal a field-level permission YAML change. Treat a JSON null as unknown, not as permission-denied or intentionally empty, unless a separate call proves otherwise. There is no published cache TTL for field-level permission boundaries.
Confirmed for the current REST API: an inaccessible field remains present in the JSON object with a null value; it is not omitted. Schema introspection returns global field definitions and editability metadata, not per-credential visibility. ETag and Last-Modified reflect entity data changes, not permission rule edits. Permission rule changes do not generate entity-scoped events.
Likely explanation: the server computes visibility per request from the YAML rules and the authenticating credential. Because no invalidation signal is emitted, a cache keyed only on entity ID can serve stale values after a YAML edit.
null, re-read the same entity with a credential known to have read access. If the privileged call returns a value, the original null was permission-denied; if it also returns null, the field likely stores an empty value.ETag, Last-Modified, or ShotGrid event listeners for permission boundaries.# Replace SHOTGRID_BASE, SCRIPT_KEY, and ENTITY_ID. Read-only probe.
curl -s "$SHOTGRID_BASE/api/v1/entity/Shot/ENTITY_ID" \
-H "X-Requested-With: XMLHttpRequest" \
-u "script_name:script_key" | jq '.field_name'
Repeat with a restricted artist credential. The key should appear in both responses; only the value should differ.
Can your client issue a second read with a privileged service account? If no, treat every null as unknown and refresh on out-of-band permission-admin events. If yes, use the privileged probe to distinguish stored null from denied null.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.