How to use GrantIdentity ?
Hi,
On ARAS R12, in server methods, I needed to grant temporary some rights.
For that, I did something like this:
[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:72a39175-e3c1-4aa3-9737-c3edc266744d:type=csharp&text=var%20myidentity%20%3D%20Aras.Server.Security.Identity.GetByName%28%22My%20Identity%22%29%3B%0D%0Abool%20PermissionWasSet%20%3D%20Aras.Server.Security.Permissions.GrantIdentity%28%29%3B%0D%0A%0D%0Atry%20%7B%0D%0A%09%2F%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2AYOUR%20SPECIAL%20CODE%20HERE%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2F%0D%0Afinally%0D%0A%7B%0D%0A%20%20%20%20if%20%28PermissionWasSet%29%20Aras.Server.Security.Permissions.RevokeIdentity%28myidentity%29%3B%0D%0A%7D]
Due to deprecated API, on ARAS R19, I need to use CCO.Permissions.GrantIdentity but this method doesn't return a boolean to know if the identity has been granted or not.
How should I do ? When and how to do the RevokeIdentity ?
Is this enough ?
[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:fe51a9bf-6590-497f-ada6-3812e157228b:type=csharp&text=using%20%28CCO.Permissions.GrantIdentity%28Aras.Server.Security.Identity.GetByName%28%22My%20Identity%22%29%29%29%0D%0A%7B%0D%0A%09%2F%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2AYOUR%20SPECIAL%20CODE%20HERE%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2F%0D%0A%7D]
Thank you in advance for your answer.