2. Manage Sandbox Access¶
Users get access to a project-related sandbox as sandbox masters: they can create and change objects in the sandbox schema. Within the sandbox, only the data that all sandbox masters may see is visible (“least privilege principle”, see Project-Related Sandboxes).
Make sure that the user and the sandbox exist:
2.1. Grant Access to a Sandbox¶
Grant a user access to a sandbox with API_SCURTY.GRANT_SBX_MASTER_ACCESS. Generic users (GU) cannot become sandbox masters.
Example: Make TESTUSER a Master of ‘TEST_SBX’
1EXECUTE SCRIPT API_SCURTY.GRANT_SBX_MASTER_ACCESS(
2 'TEST_SBX' -- p_sbx_name
3 ,'TESTUSER' -- p_user_name
4);
The sandbox master is stored in SCURTY.SBX_MASTERS:
SBX_NAME |
USER_NAME |
|---|---|
TEST_SBX |
TESTUSER |
The access is applied by the next sandbox refresh (see When Do Changes Take Effect?).
2.2. Revoke Access to a Sandbox¶
Revoke the access of a user to a sandbox with API_SCURTY.REVOKE_SBX_MASTER_ACCESS.
Example: Revoke the Access of TESTUSER
1EXECUTE SCRIPT API_SCURTY.REVOKE_SBX_MASTER_ACCESS(
2 'TEST_SBX' -- p_sbx_name
3 ,'TESTUSER' -- p_user_name
4);
The entry is removed from SCURTY.SBX_MASTERS.