API to return all file cabinets with users and rights
As requested by external auditors, we need to develop a report to list all file cabinets with users and rights assigned. According to the support analyst in SR-138877-R8P1T, the only available solution using existing API's is to connect as each user and run the existing classes and methods. However that solution is not possible as per company policies users are not allowed to share their credentials.
We were able to get the file cabinets and the rights for the connected user only with the code below, but it is necessary to get the same for all users and all file cabinets.
This is the code.
// local structure to print report
var fileCabinet = new List<FileCabinet_>();
// Connect to docuware
var conn = Connection.Connect();
// Get organization
var org = conn.Organizations[0];
// get file cabinets list
var files_ = org.GetFileCabinetsFromFilecabinetsRelation().FileCabinet;
foreach (var us in files_)
{
var cc = conn.GetFileCabinet(us.Id);
foreach (var rr in cc.Rights)
{
FileCabinet_ a = new FileCabinet_();
a.FileCabinetID = us.Id;
a.Name = us.Name;
a.IsBasket = us.IsBasket.ToString();
a.priv = rr.ToString();
fileCabinet.Add(a);
}
}
7
votes
Anonymous
shared this idea