1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Fix for admin news perms

This commit is contained in:
Cameron 2017-02-18 15:31:41 -08:00
parent 07ee77dc7d
commit b2e951d2d8
2 changed files with 9 additions and 7 deletions

View File

@ -74,14 +74,14 @@ class news_admin extends e_admin_dispatcher
protected $adminMenu = array(
'main/list' => array('caption'=> LAN_LIST, 'perm' => 'H'),
'main/create' => array('caption'=> NWSLAN_45, 'perm' => 'H'), // Create/Edit News Item
'main/list' => array('caption'=> LAN_LIST),
'main/create' => array('caption'=> NWSLAN_45), // Create/Edit News Item
// 'cat/list' => array('caption'=> NWSLAN_46, 'perm' => '7'), // Category List
'cat/list' => array('caption'=> LAN_CATEGORIES, 'perm' => 'H'), // Create Category.
'cat/create' => array('caption'=> LAN_NEWS_63, 'perm' => 'H'), // Category List
'main/settings' => array('caption'=> LAN_PREFS, 'perm' => '0'), // Preferences
'cat/list' => array('caption'=> LAN_CATEGORIES), // Create Category.
'cat/create' => array('caption'=> LAN_NEWS_63), // Category List
'main/settings' => array('caption'=> LAN_PREFS), // Preferences
// 'main/submitted' => array('caption'=> LAN_NEWS_64, 'perm' => 'N'), // Submitted News
'sub/list' => array('caption'=> NWSLAN_47, 'perm' => 'N'), // Submitted News
'sub/list' => array('caption'=> NWSLAN_47), // Submitted News
// 'main/maint' => array('caption'=> LAN_NEWS_55, 'perm' => '0') // Maintenance
);

View File

@ -1123,11 +1123,13 @@ class e_admin_dispatcher
{
return false;
}
// generic dispatcher admin permission (former getperms())
if(null !== $this->perm && is_string($this->perm) && !e107::getUser()->checkAdminPerms($this->perm))
{
return false;
}
return true;
}
@ -1138,7 +1140,7 @@ class e_admin_dispatcher
return false;
}
if(is_array($this->perm) && !empty($this->perm[$route]) && !e107::getUser()->checkAdminPerms($this->perm[$route]))
if(is_array($this->perm) && isset($this->perm[$route]) && !e107::getUser()->checkAdminPerms($this->perm[$route]))
{
return false;
}