user capabilities restricted to access specific pages only in wordpress
<p>i want to create a user in wordpress that will have access to only few pages in wordpress and nothing else, this user can edit , delete ,update and crreate any thing or cutomize the pages allowed to him only having no access to any other things in wordpress for that i have tried many plugins like :
UAM User Access manager
press permit Core
Role scoper
but they are not according to my needs or may be i am not using them well . any help in that will be appreciated .  i have also tried to create user through code from the backend but was not able to complete it correctly please provide any relevent help as early as possible :
i have created role through this :</p>

<pre><code>$result = add_role(
    'basic_contributor',
    __( 'Basic Contributor' ),
    array(
        'read'         =&gt; true,  // true allows this capability
        'edit_posts'   =&gt; true,
        'delete_posts' =&gt; false, // Use false to explicitly deny
    )
);
if ( null !== $result ) {
    echo 'Yay! New role created!';
}
else {
    echo 'Oh... the basic_contributor role already exists.';
}
</code></pre>

<p>..............</p>

<pre><code>function add_roles_on_plugin_activation() {
       add_role( 'custom_role', 'Custom Subscriber', array( 'read' =&gt; true, 'level_0' =&gt; true ) );
   }
   register_activation_hook( __FILE__, 'add_roles_on_plugin_activation' );
</code></pre>

<p>but it didn't helped me much ..</p>