Below is the example of using the SetMbSec operation for creating the access attribute that will be set for repository objects. The request contains repository connection moniker, metadata of created attribute and the template that indicates the executed operation. The response contains the refreshed list of attributes created for repository objects.
{
"SetMbSec" :
{
"tMbSec" :
{
"id" : "OPDDHJLMNAHEGOAECCMGGNONOJPPADBECIAFGNMNAKEEBIFB!M"
},
"tArg" :
{
"pattern" :
{
"abacAttr" :
{
"op" : "Add",
"type" : "Global"
}
},
"meta" :
{
"abacObjAttrs" :
{
"its" :
{
"Item" :
{
"n" : "Mask for ability to get data",
"id" : "ABAC_READDATA",
"k" : "2147483647",
"dataType" : "Integer",
"defaultValue" : "1"
}
}
}
},
"metaGet" :
{
"pattern" :
{
"abacAttr" :
{
"op" : "Get",
"type" : "Global"
}
}
}
}
}
}
{
"SetMbSecResult" :
{
"id" :
{
"id" : "OPDDHJLMNAHEGOAECCMGGNONOJPPADBECIAFGNMNAKEEBIFB!M"
},
"metaGet" :
{
"id" :
{
"id" : "OPDDHJLMNAHEGOAECCMGGNONOJPPADBECIAFGNMNAKEEBIFB!M"
},
"meta" :
{
"bisearchEnable" : "Disable",
"abacObjAttrs" :
{
"its" :
{
"Item" :
[
{
"n" : "Access permissions mask",
"id" : "RIGHTS",
"description" : "",
"k" : "1",
"dataType" : "String",
"defaultValue" : "",
"UI" : ""
},
{
"n" : "Mask of blocks (REN, TPR, ONIM)",
"id" : "UNIT",
"description" : "",
"k" : "2",
"dataType" : "String",
"defaultValue" : "",
"UI" : ""
},
{
"n" : "Mask for ability to get data",
"id" : "ABAC_READDATA",
"description" : "",
"k" : "3",
"dataType" : "Integer",
"defaultValue" : "1",
"UI" : ""
}
]
}
}
}
}
}
}
public static SetMbSecResult AddABACObjectAttrs(string mb)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetMbSec()
{
tArg = new SetMbSecArg()
{
meta = new MbSecMd()
{
abacObjAttrs = new MbSecAbacAttributes()
{
its = new MbSecAbacAttribute[]
{
new MbSecAbacAttribute()
{
dataType = MbSecAbacDataType.Integer,
id = "ABAC_READDATA",
n = "Mask for ability to get data",
defaultValue = "1",
k = int.MaxValue
}
}
}
},
pattern = new MbSecMdPattern()
{
abacAttr = new MbSecAbacPatternFilter()
{
op = ListOperation.Add,
type = MbSecAbacAttrType.Global
}
},
metaGet = new GetMbSecArg()
{
pattern = new MbSecMdPattern()
{
abacAttr = new MbSecAbacPatternFilter()
{
op = ListOperation.Get,
type = MbSecAbacAttrType.Global
}
}
}
},
tMbSec = new MbId() { id = mb }
};
// Create access attribute for repository objects
var result = somClient.SetMbSec(tSet);
return result;
}
See also: