Type : CREATION_INTERNE
Le script ne charge pas de données externes mais interagit avec le référentiel de métadonnées système.
| 1 | DATA _null_; |
| 2 | /**** Initialize Variables ****/ |
| 3 | LENGTH uri $ 38 cap_uri $ 43; |
| 4 | call missing (of _character_); |
| 5 | |
| 6 | /**** Create the object. ****/ |
| 7 | rc=metadata_newobj("IdentityGroup",uri,"New Role Name"); |
| 8 | |
| 9 | /* Add some required attributes. */ |
| 10 | rc=metadata_setattr(uri,"PublicType","Role"); |
| 11 | rc=metadata_setattr(uri,"GroupType","ROLE"); |
| 12 | rc=metadata_setattr(uri,"UsageVersion","1000000.0"); |
| 13 | rc=metadata_setattr(uri,"IsHidden","0"); |
| 14 | |
| 15 | /* Add some optional attributes. */ |
| 16 | rc=metadata_setattr(uri,"Desc","This is the description of the new role"); |
| 17 | rc=metadata_setattr(uri,"DisplayName","This is the display name of the new role"); |
| 18 | |
| 19 | /**** Add a capability. ****/ |
| 20 | |
| 21 | /* Define the search for the access control entry for the capability */ |
| 22 | cap_obj="omsobj:AccessControlEntry?AccessControlEntry[Objects/ApplicationAction[ @Name='Server Manager']]"; |
| 23 | |
| 24 | /* Pull it's URI into the variable cap_uri */ |
| 25 | rc=metadata_getnobj(cap_obj,1,cap_uri); |
| 26 | |
| 27 | /* Add the capability association to the role. */ |
| 28 | rc=metadata_setassn(uri,"AccessControlEntries","APPEND",cap_uri); |
| 29 | |
| 30 | /**** Add the Role to a Group ****/ |
| 31 | rc=metadata_setassn(uri,"MemberIdentities","APPEND","omsobj:IdentityGroup? @Name='group1'"); |
| 32 | RUN; |