Forum Discussion

Lokesh's avatar
Lokesh
Ideator I
6 years ago

Execute Process with current User

Hi,

I have a use case where the user will create a background task, the task is picked by agentservice and executes it using super user privileges.

But i want it to run using the normal user privileges, i am unable to achieve this with the code 

Aras.Server.Security.Identity plmIdentity = Aras.Server.Security.Identity.GetById(currentUserId);
bool permissionWasSet = Aras.Server.Security.Permissions.GrantIdentity(plmIdentity);

How do i achieve this ?

Thanks,

Lokesh Dogga.

1 Reply

  • I am not sure what you want to achieve. When you just don´t use these two lines of code at all, your code will be run with the current user permissions.