diff --git a/modules/user_preferences/user_preferences.module b/modules/user_preferences/user_preferences.module index 882c604d63fd9c27e8655e28b64e18cd9e902ad1..62c06041377e86807d595e300659c49cb8945f4a 100644 --- a/modules/user_preferences/user_preferences.module +++ b/modules/user_preferences/user_preferences.module @@ -48,7 +48,7 @@ function user_preferences_node_links_alter(array &$links, NodeInterface $node, a $is_book = isset($node->book['bid']); if(!$is_admin){ - $can_add_child_page = in_array('Add content and child pages to books and manage their hierarchies', user_role_permissions($user->getRoles())); + $can_add_child_page = $user->hasPermission('Add content and child pages to books and manage their hierarchies'); } if ($context['view_mode'] == 'full' && node_is_page($node)) {