I am following this walkthrough for getting the access of a user to an account in dynamics crm using C#. When I tried to check that if user have AppendAccess it is not working properly and while debugging I found these rights in the following form.
I want to check if a user have AppendAccess then do the next. what I tried is in the following:
if(principalAccessRes.AccessRights.Equal("AppendAccess "))
{
Console.WriteLine("User have Append Access");
}
Because AccessRights
is a [Flag]
you need to check if the access rights response includes (HAVE) instead of equal.
if(principalAccessRes.AccessRights.HasFlag(AccessRights.AppendAccess))
{
Console.WriteLine("User have Append Access");
}