?>Array ( [id] => 6 )
Scénario de test & Cas d'usage
Simulate a scenario with an active user ('active_user_empty') who has no tables in their personal caslib. We will also test against a user ('inactive_user') who does not have an active CAS session.
| 1 | /* No data setup is required. The test relies on the state of user sessions and their caslibs (or lack thereof). We assume 'active_user_empty' has a session and 'inactive_user' does not. */ |
| 1 | PROC CAS; |
| 2 | ACCESSCONTROL.accessPersonalCaslibs; |
| 3 | RUN; |
| 1 | PROC CAS; |
| 2 | /* Should run without error and produce an empty table list */ |
| 3 | TABLE.tableInfo / caslib="CASUSER(active_user_empty)"; |
| 4 | RUN; |
| 1 | PROC CAS; |
| 2 | /* Should fail with a 'caslib not found' error, not 'access denied' */ |
| 3 | TABLE.tableInfo / caslib="CASUSER(inactive_user)"; |
| 4 | RUN; |
The test demonstrates the robustness of an administrative script. The action on the empty caslib succeeds, preventing the script from failing unnecessarily. The action on the non-existent caslib fails with a predictable 'not found' error, which can be trapped and handled by the script, rather than an untrappable authorization error. This confirms the action behaves correctly in edge-case scenarios.