Sitecore 8.2
I need to login virtual user with name like 'virtualUser2000' (not 'sitecore\virtualUser2000') to sitecore content editor. My code:
var virtualUser = _authenticationManager.BuildVirtualUser("virtualUser2000", true);
virtualUser.Roles.Add(Role.FromName("I can edit content in Content Editor"));
Role scRole =_rolesInRolesManager.GetEveryoneRole(_domainManager.GetDomain("sitecore"));
virtualUser.Roles.Add(scRole);
bool isSuccess = _authenticationManager.LoginVirtualUser(virtualUser);
string ticket = _ticketManager.CreateTicket("virtualUser2000", @"/sitecore/shell");
if (current != null)
{
HttpCookie cookie = new HttpCookie(Sitecore.Web.Authentication.TicketManager.CookieName, ticket)
{
HttpOnly = false
};
current.Response.AppendCookie(cookie);
}
My virtual user has access to sitecore content editor but cannot edit content. There is a warning in content editor on all items:
I think it happens because 'sitecore\everyone' role does not apply to user. As I found out 'sitecore\everyone' role give access to languages for users. I think I can share access to read/write languages for my "I can edit content in Content Editor" role but I would like to have another solution because I suppose that 'sitecore\everyone' role also responsible for other user permissions.
How can I assign 'sitecore\everyone' role to user?