How did you assign permissions to a Editor role from the code

No, the permissions that I want to add from the code are these: