I am having trouble figuring out how to set permissions for users I personally did not programmatically create in my site installation profile. Can someone please help?
I would like to set 'View published content' as true for the ANONYMOUS USER user role in the .install file.
I am using the code below to grant permissions; but I do not know how to access permissions for the ANONYMOUS USER role.
// Create the roles.
$roles['Content editor'] = array(
'name' => 'Content editor',
'weight' => $weight++,
'permissions' => $base_permissions,
);
foreach ($roles as $role) {
$role_object = new stdClass();
$role_object->name = $role['name'];
$role_object->weight = $role['weight'];
// Save the role.
user_role_save($role_object);
// Grant permissions.
if (!empty($role['permissions'])) {
user_role_grant_permissions($role_object->rid, $role['permissions']);
}