Get role privilege structure
Forms the privilege information structure for use when working with roles
Function GetRolePrivilegeStructure(Val Resource, Val ActionsArray) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Resource | --res | Structure Of KeyAndValue | ✔ | Privilege resource |
| ActionsArray | --act | Array Of String | ✔ | Array of available privilege actions |
Returns: Structure - Privilege structure
tip
Resource can be defined in one of the following formats:
Structure for collection: { db: "database", collection: "collection name" }
Structure for toлawithтерa: { cluster : true }
1C:Enterprise/OneScript code example
Base = "main";
Resource = New Structure("db,collection", Base, "new_collection");
Actions = New Array;
Actions.Add("find");
Actions.Add("insert");
Actions.Add("update");
Result = OPI_MongoDB.GetRolePrivilegeStructure(Resource, Actions);
- Bash
- CMD/Bat
# JSON data can also be passed as a path to a .json file
oint mongodb GetRolePrivilegeStructure \
--res "{'db':'main','collection':'new_collection'}" \
--act "['find','insert','update']"
:: JSON data can also be passed as a path to a .json file
oint mongodb GetRolePrivilegeStructure ^
--res "{'db':'main','collection':'new_collection'}" ^
--act "['find','insert','update']"
Result
{
"resource": {
"db": "main",
"collection": "new_collection"
},
"actions": [
"***",
"***",
"***"
]
}