I want to create a new role. New role should have all the permissions of authenticated user as well as the some new permissions.
I used the following code,
$role = new stdClass(); $role->name = 'New role'; // load the authenticated user role $auth_role = user_role_load(DRUPAL_AUTHENTICATED_RID); $role->weight = $auth_role->weight + 1; user_role_save($role);
and I will assign the permissions using user_role_change_permissions() or user_role_grant_permissions()
Now I want to assign the authenticated user permissions to this new role. How to achieve this?