Scénario de test & Cas d'usage
Management of access rights and data security.
Discover all actions of accessControlCreate a sensitive employee salary table and a restricted production caslib to house it.
| 1 | DATA sensitive_hr.salaries; |
| 2 | LENGTH EmployeeID $10 Name $50; |
| 3 | EmployeeID = 'E1001'; Name = 'John Smith'; Salary = 120000; OUTPUT; |
| 4 | EmployeeID = 'E1002'; Name = 'Jane Doe'; Salary = 135000; OUTPUT; |
| 5 | EmployeeID = 'E1003'; Name = 'Peter Jones'; Salary = 95000; OUTPUT; |
| 6 | RUN; |
| 1 | PROC CAS; |
| 2 | addCaslib / caslib='sensitive_hr' dataSource={srcType='PATH'} path='/cas/data/sensitive_hr'; |
| 3 | TABLE.loadTable / caslib='sensitive_hr' path='salaries.sashdat' casOut={name='salaries', caslib='sensitive_hr', promote=true}; |
| 4 | RUN; |
| 1 | PROC CAS; |
| 2 | /* This step is expected to produce an error note in the log */ |
| 3 | ACCESSCONTROL.listControls / TABLE={caslib='sensitive_hr', name='salaries'}; |
| 4 | RUN; |
| 1 | |
| 2 | PROC CAS; |
| 3 | ACCESSCONTROL.assumeRole / adminRole=' |
| 4 | DATA'; |
| 5 | RUN; |
| 6 |
| 1 | |
| 2 | PROC CAS; |
| 3 | ACCESSCONTROL.listControls / TABLE={caslib='sensitive_hr', name='salaries'}; |
| 4 | RUN; |
| 5 |
| 1 | PROC CAS; |
| 2 | ACCESSCONTROL.dropRole / adminRole='DATA'; |
| 3 | /* Verify permissions are reverted by attempting the admin action again, expecting failure */ |
| 4 | ACCESSCONTROL.listControls / TABLE={caslib='sensitive_hr', name='salaries'}; |
| 5 | RUN; |
The scenario is successful if the Data Steward can only list access controls (step 4) after assuming the 'DATA' role. The attempts in step 2 and the final check in step 5 must fail, proving that the elevated permissions are temporary and correctly scoped to the assumed role.