Custom Role with Own Page Edit Capability

I’ve managed to solve this with a little bit of “patching” and thanks to the explanation on both these threads: Remove ability to access certain admin menus & Hide Admin menus per role in WordPress

I added to the restrict_menus function the items which access I needed forbidden, and hid in the remove_menus the list items I was able to.
I’ve also enqueue an admin stylesheet to be launched when this role was active and with that hide the plugin items that were showing.

this is my final code now:

//remove_role( 'Supervisor'); // developing purposes only

$result = add_role( 'Supervisor', 
__('Supervisor' ),
  array( 

 'read' => true,
 'create_posts' => false,
 'create_pages' => false,
 'moderate_comments' => false,
 'edit_pages' => true, 
 'publish_pages' => true,
 'edit_published_pages' => true,
) 
);

function restrict_menus(){

$author = wp_get_current_user();
 if(isset($author->roles[0])){ 
 $current_role = $author->roles[0];
}else{
$current_role="no_role";
}

if($current_role == 'Supervisor'){  

$screen = get_current_screen();
$base = $screen->id;


if($base == 'edit-post' || $base == 'tools' || $base == 'edit-comments' || 
$base == 'page' && $action == 'add' || $base == 'te_announcements' && $action == 'add')
{  
wp_die('Não tem permissões para aceder a esta área');
}
}

}

add_action( 'current_screen', 'restrict_menus' );

function remove_menus()
{
global $menu;

$author = wp_get_current_user();
if(isset($author->roles[0])){ 
$current_role = $author->roles[0];
}else{
$current_role="no_role";
}

if($current_role == 'Supervisor')
{
$restricted = array(__('Comments'),
                    __('Appearance'),
                    __('Plugins'),
                    __('Tools'),
                    __('Settings'),
                    __('Posts'),

);
end ($menu);
while (prev($menu)){
    $value = explode(' ',$menu[key($menu)][0]);
    if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
}// end while

}// end if
}
add_action('admin_menu', 'remove_menus');

If anybody has a better way, please tell me so.

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş