Scénario de test & Cas d'usage
Management of access rights and data security.
Discover all actions of accessControlCreate a CAS table containing the definition of a new, simple custom action set.
| 1 | DATA public.actionset_source; |
| 2 | LENGTH definition $ 500; |
| 3 | definition = 'action customScoring.simpleScore;'; OUTPUT; |
| 4 | definition = ' input {table {name="DATA"}};'; OUTPUT; |
| 5 | definition = ' output {table {name="scored_data"}};'; OUTPUT; |
| 6 | definition = ' /* A simple scoring logic placeholder */'; OUTPUT; |
| 7 | definition = ' data.score = data.value * 1.1;'; OUTPUT; |
| 8 | definition = 'endaction;'; OUTPUT; |
| 9 | RUN; |
| 1 | |
| 2 | PROC CAS; |
| 3 | TABLE.loadTable / caslib='PUBLIC' path='actionset_source.sashdat' casOut={name='actionset_source', caslib='PUBLIC', promote=true}; |
| 4 | RUN; |
| 5 |
| 1 | PROC CAS; |
| 2 | /* This step should fail with an authorization error */ |
| 3 | BUILTINS.installActionSet / actionSet='customScoring' TABLE={caslib='PUBLIC', name='actionset_source'}; |
| 4 | RUN; |
| 1 | |
| 2 | PROC CAS; |
| 3 | ACCESSCONTROL.assumeRole / adminRole='ACTION'; |
| 4 | RUN; |
| 5 |
| 1 | |
| 2 | PROC CAS; |
| 3 | BUILTINS.installActionSet / actionSet='customScoring' TABLE={caslib='PUBLIC', name='actionset_source'}; |
| 4 | RUN; |
| 5 |
| 1 | PROC CAS; |
| 2 | BUILTINS.actionSetInfo / actionSet='customScoring'; |
| 3 | BUILTINS.help / ACTION='customScoring.simpleScore'; |
| 4 | RUN; |
| 1 | PROC CAS; |
| 2 | ACCESSCONTROL.dropRole / adminRole='ACTION'; |
| 3 | /* As an admin, you would unload the action set */ |
| 4 | /* accessControl.assumeRole / adminRole='ACTION'; */ |
| 5 | /* builtins.uninstallActionSet / actionSet='customScoring'; */ |
| 6 | RUN; |
The scenario succeeds if the action set installation fails initially (step 2), but succeeds after assuming the 'ACTION' role (step 4). The verification in step 5 must show that the 'customScoring' action set and its 'simpleScore' action are correctly loaded and visible. This validates that the 'ACTION' role correctly grants the necessary permissions for this MLOps workflow.