Does ShotGrid permission caching differ between local and production environments?
26.5K reputation · 18 Aug 2024, 12:49 UTC
ShotGrid utilizes role-based access control (RBAC) to manage user permissions based on group memberships. In local development environments, configurations often rely on in-memory caches or embedded databases, whereas production deployments typically utilize persistent caching layers and external database clusters.
There is uncertainty regarding how these divergent caching mechanisms handle permission state persistence, particularly when group memberships are updated after a user session has already been established. If production environments enforce stricter session-based permission snapshots compared to local setups, it could lead to scenarios where access changes do not propagate in real-time.
- Does ShotGrid's permission evaluation logic vary when moving from a local in-memory cache to a production persistent cache?
- What is the expected behavior for group membership updates regarding session refresh requirements in a production environment?
1 answer
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
26,525 reputation · 18 Aug 2024, 19:50 UTC
Clarification on cache scope and manual invalidation
ShotGrid’s permission cache is implemented with the same caching library across all deployments; in a clustered production setup the cache is backed by a distributed store (e.g., Ehcache with Terracotta or Redis) so every application node reads from a shared permission state. A local or sandbox instance typically runs a single‑JVM cache, but the underlying API calls (get/put, TTL handling) are identical.
Because the cache is shared, updating a group membership does not require a server restart; administrators can invalidate the permission cache immediately through the Admin UI (Site Preferences → Caching → Clear Permission Cache) or by calling the internal API endpoint POST /api/v1/entity/PermissionCache?action=clear. After a flush, the next permission check will hit the database and repopulate the cache, ensuring that permission changes propagate without waiting for the TTL to expire.