Creating Access Attribute for Repository Objects

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetMbSec xmlns="http://www.fsight.ru/PP.SOM.Som">
<tMbSec xmlns="">
  <id>OPDDHJLMNAHEGOAECCMGGNONOJPPADBECIAFGNMNAKEEBIFB!M</id>
  </tMbSec>
<tArg xmlns="">
<pattern>
<abacAttr>
  <op>Add</op>
  <type>Global</type>
  </abacAttr>
  </pattern>
<meta>
<abacObjAttrs>
<its>
<Item>
  <n>Mask for ability to get data</n>
  <id>ABAC_READDATA</id>
  <k>2147483647</k>
  <dataType>Integer</dataType>
  <defaultValue>1</defaultValue>
  </Item>
  </its>
  </abacObjAttrs>
  </meta>
<metaGet>
<pattern>
<abacAttr>
  <op>Get</op>
  <type>Global</type>
  </abacAttr>
  </pattern>
  </metaGet>
  </tArg>
  </SetMbSec>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetMbSecResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>OPDDHJLMNAHEGOAECCMGGNONOJPPADBECIAFGNMNAKEEBIFB!M</id>
  </id>
<metaGet xmlns="">
<id>
  <id>OPDDHJLMNAHEGOAECCMGGNONOJPPADBECIAFGNMNAKEEBIFB!M</id>
  </id>
<meta>
  <bisearchEnable>Disable</bisearchEnable>
<abacObjAttrs>
<its>
<Item>
  <n>Access permissions mask</n>
  <id>RIGHTS</id>
  <description />
  <k>1</k>
  <dataType>String</dataType>
  <defaultValue />
  <UI />
  </Item>
<Item>
  <n>Mask of blocks (REN, TPR, ONIM)</n>
  <id>UNIT</id>
  <description />
  <k>2</k>
  <dataType>String</dataType>
  <defaultValue />
  <UI />
  </Item>
<Item>
  <n>Mask for ability to get data</n>
  <id>ABAC_READDATA</id>
  <description />
  <k>3</k>
  <dataType>Integer</dataType>
  <defaultValue>1</defaultValue>
  <UI />
  </Item>
  </its>
  </abacObjAttrs>
  </meta>
  </metaGet>
  </SetMbSecResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"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"
}
}
}
}
}
}

JSON response:

{
"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:

SetMbSec: Operation