Hi, is there a way to disable list configuration for users so that only admin can create them and make them available? Very useful as some information in my roles should be restricted to other role members but using list they can see everything!
thanks Mark, ideally i would like List and Own Lists to be only available when admin logged in both in the right hand menu and the Overview menu.
thanks
Lists
- Thomas-RCV
- Former team member
- Beiträge: 786
- Registriert: 1. Aug 2011, 15:06
Re: Lists
Hi Mark,
If you feel conifident changing two php scripts it is quiet trivial to show the links only for the admin.
We provide the function hasRole() to handle actions if user is member of a role.
To change the overview find the script in adm_program/index.php
Find section in line 112
Change to:
The same for the sidebar menue in adm_themes/modern(classic)/my_body_bottom.php
Changing this the links are only shown if the current user is admin.
Best,
Thomas
If you feel conifident changing two php scripts it is quiet trivial to show the links only for the admin.
We provide the function hasRole() to handle actions if user is member of a role.
To change the overview find the script in adm_program/index.php
Find section in line 112
Code: Alles auswählen
$moduleMenu->addItem('lists', '/adm_program/modules/lists/lists.php',
$gL10n->get('LST_LISTS'), '/icons/lists_big.png',
$gL10n->get('LST_LISTS_DESC'));
$moduleMenu->addSubItem('lists', 'mylist', '/adm_program/modules/lists/mylist.php',
$gL10n->get('LST_MY_LIST'));
$moduleMenu->addSubItem('lists', 'rolinac', '/adm_program/modules/lists/lists.php?active_role=0',
$gL10n->get('ROL_INACTIV_ROLE'));
Code: Alles auswählen
If hasRole("Webmaster")
{
$moduleMenu->addItem('lists', '/adm_program/modules/lists/lists.php',
$gL10n->get('LST_LISTS'), '/icons/lists_big.png',
$gL10n->get('LST_LISTS_DESC'));
$moduleMenu->addSubItem('lists', 'mylist', '/adm_program/modules/lists/mylist.php',
$gL10n->get('LST_MY_LIST'));
$moduleMenu->addSubItem('lists', 'rolinac', '/adm_program/modules/lists/lists.php?active_role=0',
$gL10n->get('ROL_INACTIV_ROLE'));
}
Changing this the links are only shown if the current user is admin.
Best,
Thomas
Re: Lists
Thanks Thomas, that works great, can the function be used for multiple roles so certain groups of members can see the item?
thanks Mark
thanks Mark
- Thomas-RCV
- Former team member
- Beiträge: 786
- Registriert: 1. Aug 2011, 15:06
Re: Lists
For sure. Just pass the roles to the function
hasRole ("Webmaster", "chairman", "member")
Best
hasRole ("Webmaster", "chairman", "member")
Best
Re: Lists
Thanks,
Had to change it to
If (hasRole('Webmaster'))
Otherwise no page loaded
also wanted Webmaster or coach rather than being member of both
thanks Mark
Had to change it to
If (hasRole('Webmaster'))
Otherwise no page loaded
also wanted Webmaster or coach rather than being member of both
thanks Mark
Re: Lists
thanks for sharing its really helpful for meThomas-RCV hat geschrieben:Hi Mark,
If you feel conifident changing two php scripts it is quiet trivial to show the links only for the admin.
We provide the function hasRole() to handle actions if user is member of a role.
To change the overview find the script in adm_program/index.php
Find section in line 112
Change to:Code: Alles auswählen
$moduleMenu->addItem('lists', '/adm_program/modules/lists/lists.php', $gL10n->get('LST_LISTS'), '/icons/lists_big.png', $gL10n->get('LST_LISTS_DESC')); $moduleMenu->addSubItem('lists', 'mylist', '/adm_program/modules/lists/mylist.php', $gL10n->get('LST_MY_LIST')); $moduleMenu->addSubItem('lists', 'rolinac', '/adm_program/modules/lists/lists.php?active_role=0', $gL10n->get('ROL_INACTIV_ROLE'));
The same for the sidebar menue in adm_themes/modern(classic)/my_body_bottom.phpCode: Alles auswählen
If hasRole("Webmaster") { $moduleMenu->addItem('lists', '/adm_program/modules/lists/lists.php', $gL10n->get('LST_LISTS'), '/icons/lists_big.png', $gL10n->get('LST_LISTS_DESC')); $moduleMenu->addSubItem('lists', 'mylist', '/adm_program/modules/lists/mylist.php', $gL10n->get('LST_MY_LIST')); $moduleMenu->addSubItem('lists', 'rolinac', '/adm_program/modules/lists/lists.php?active_role=0', $gL10n->get('ROL_INACTIV_ROLE')); }
Changing this the links are only shown if the current user is admin.
Best,
Thomas
ayaha