- Regarding "Menu > Settings" , You can able to select
Source for the Main Links (Primary menu)
Select what should be displayed as the Main links (typically at the
top of the page).
Select the source menu for the Secondary links.
For example, If you created a new menu called Header Menu and added some links, now you would like to display Header Menu as Main Menu on top of page which is nothing but Primary Links. In that case you have to set "Source for the main links to " Header Menu.
Yes, You can able to read these values using below code
$primary_menu = variable_get('menu_main_links_source', 'main-menu')
$secondary_menu = variable_get('menu_secondary_links_source', 'user-menu'),
- Regarding menus based on roles
You can try using Menu Item Visibility Module
This module exposes configurable and extendable visibility settings
for menu links. For example, if you want to create a 'My account' link
that points to /user, both anonymous and registered users have access
to the /user path, so both will see the link, even if anonymous users
do not technically have an account.