Posted on: 09/16/05 02:24pm
By: gtgillis
I have a registered user that I gave Story Admin rights. When this user logs in he can see the admin menu containing links for Submissions and Stories. When he clicks on Submissions he sees the Stories and Logout icons and links but also present is the icon and link for File Management.
If he clicks on the link he sees an error that he has no access. I have not granted him filemgmt Admin rights.
How can I get rid of the link and icon when he clicks Submissions?
File Management admin link should not show up
Posted on: 09/16/05 06:19pm
By: Dirk
Looks like the File Management plugin is missing a permission check there ...
In the plugin's functionc.inc file, find this:
function plugin_cclabel_filemgmt()
{
global $LANG_FILEMGMT, $_CONF;
return array($LANG_FILEMGMT['plugin_name'],$_CONF['site_admin_url'] . '/plugins/filemgmt/index.php',$_CONF['site_url'] . '/filemgmt/images/filemgmt.gif');
}
and add the permission check (which you can copy from the function plugin_getuseroption_filemgmt just below that function):
function plugin_cclabel_filemgmt()
{
global $LANG_FILEMGMT, $_CONF;
if (SEC_hasRights('filemgmt.upload')) {
return array($LANG_FILEMGMT['plugin_name'],$_CONF['site_admin_url'] . '/plugins/filemgmt/index.php',$_CONF['site_url'] . '/filemgmt/images/filemgmt.gif');
}
}
That should fix it.
bye, Dirk
File Management admin link should not show up
Posted on: 09/16/05 07:08pm
By: gtgillis
Thanks.
I had to change it to filemgmt.edit since all logged in users can upload.
Here is the code that worked
function plugin_cclabel_filemgmt()
{
global $LANG_FILEMGMT, $_CONF;
if (SEC_hasRights('filemgmt.edit')) {
return array($LANG_FILEMGMT['plugin_name'],$_CONF['site_admin_url'] . '/plugins/filemgmt/index.php',$_CONF['site_url'] . '/filemgmt/images/filemgmt.gif');
}
}
Thanks for the help.
Regards,
Greg