A custom plugin is throwing an error indicating 'Shelby - Update user roles' plugin - RemoveUserFromRole (UserId=36961, RoleId=233) - Error - You do not have the 'manage membership' permission that is required to complete this action.
I thought I knew which user is utilized (based on input from developers), but they all show Administrators role which has suitable privileges (the one in question is marked).
So, where would this be defined? In the custom plugin, or some other environment variable.
It is running in the context of the user who initiated the request that caused the plugin to execute. You would need to impersonate inside of a plugin to get a consistent user
We had constructed the plugin (and it was working) to impersonate for certain user, but it appears to be running in context of user initiating (such as user signing in, since it calls out with signin event). Is there something in server config that could prevent impersonation? At a loss. Nothing has changed. Was working, now it is not working.
You just need to wrap the code that needs elevated privileges in the following call. Is that how you are accomplishing this?
Apis.Get<IUsers>().RunAsUser("admin", () => { //Do stuff here });
Thanks for info. When I checked code, it appears that the one action is set to run by certain user (as noted above), but not for the other.