I am trying to programmatically add a user to the BackendUsers role (which occurs via the site, when you check the 'can access backend' box when creating a user).
I do know you can call:
This sets the user as being Is_Backend_User (sets this to 1) in the database. However, unlike what is said in the documentation, it does not seem to have the same function as checking the box in the backend.
To function, my code requires that the user be in the BackendUsers role explicitly. I have tried manually adding this role to the user:
Role role = roleManager.GetRole("BackendUsers");
However, the role is returned as null (I guess because it is not a custom role).
Can anybody suggest how I can manually add the BackendUsers role to the specified user?
Thanks in advance,