Skip to content

Commit

Permalink
Bug: 13049 Honor resource_management perms.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Aug 29, 2014
1 parent 93853e2 commit ccbd210
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion kronolith/lib/Ajax/Application/Handler.php
Expand Up @@ -1046,7 +1046,8 @@ public function saveCalendar()
if (!$calendar_id) {
// New resource
// @TODO: Groups.
if (!$GLOBALS['registry']->isAdmin()) {
if (!$GLOBALS['registry']->isAdmin() &&
!$GLOBALS['injector']->getInstance('Horde_Core_Perms')->hasAppPermission('resource_management')) {
$GLOBALS['notification']->push(_("You are not allowed to create new resources."), 'horde.error');
return $result;
}
Expand Down
3 changes: 2 additions & 1 deletion kronolith/lib/Resource/Base.php
Expand Up @@ -99,7 +99,8 @@ public function set($property, $value)
public function hasPermission($user, $permission = Horde_Perms::READ, $restrict = null)
{
if (($permission & (Horde_Perms::EDIT | Horde_Perms::DELETE)) &&
!$GLOBALS['registry']->isAdmin()) {
!$GLOBALS['registry']->isAdmin() &&
!$GLOBALS['injector']->getInstance('Horde_Core_Perms')->hasAppPermission('resource_management')) {
return false;
}

Expand Down

0 comments on commit ccbd210

Please sign in to comment.