I have a content type which I am creating on install profile, and I want to create a user that has permissions to edit that content type. How do I create user roles and permissions for those roles in the install profile?
To add a role you can use
$role = new stdClass(); $role->name = 'role_name'; $role->weight = 5; user_role_save($role);
To grant specific permissions to a role you can use
$grant = array('access content', 'access comments', 'etc...'); user_role_grant_permissions($role->rid, $grant);