can you tri with this code
in second method you will write this code
Item ite=inn.newItem("part document",,"get");
Aras.Server.Security.Identity tempid=Aras.Server.Security.Identity.GetByName("Aras PLM");
revoke the permisssiona in place of grantprem try revoke.
Just as second opinion to this use case:
We wanted to do something similiar, but decided to choose a different approach. Instead of releasing all related item automatically, we added a precheck that allows the promotion of the source item only when all related items are released. We use this check mainly for BOM items.
Background: The risk that you automatically release items that contain errors is very high, espcially when you have very large BOMs with hundrests ot items.
In the beginning, this approach will lead to a huge amount of work cause everything has to be reviewed. But you will soon reach a state, where your most use related items are released. So later you just have to take care for the unreleased items and don´t have to check all elements in your relationship again and again.
Espcially for large BOM this of course means a lot of work in the beginning. But after some time you will save a lot of time.