Skip to content

Commit

Permalink
Completed command with permission changes
Browse files Browse the repository at this point in the history
// TODO: Change permissions to allow any user read the menu entry.
  • Loading branch information
DomingoLlanes committed Dec 21, 2016
1 parent e51e0d4 commit 661ba26
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions bin/menu/mnuAdd.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,26 @@ public static function runMe(&$params, $debug = true) {
return array('ok' => false, 'msg' => __('Parent menu not found.'));
}
}
// TODO: Change permissions to allow any user read the menu entry.
return driverCommand::run('addNode', $params);
// TODO: Change permissions to allow any user read the menu entry.
// Modified by: Domingo Llanes <domingollanes.dev@gmail.com>

$respAddNode = driverCommand::run('addNode', $params);

if ($respAddNode['ok'] === TRUE)
{
$respChmodNode = driverCommand::run('chmodNode', array(
'nodetype' => 'node_menu',
'nid' => $respAddNode['nid'],
'flags' => '3908'
));

if($respChmodNode['ok'] === FALSE)
{
return $respChmodNode;
}
}

return $respAddNode;
}

public static function getHelp() {
Expand Down Expand Up @@ -133,4 +151,4 @@ public static function getAccess($ignore = "") {
// }
}
}
return new commandMnuAdd();
return new commandMnuAdd();

0 comments on commit 661ba26

Please sign in to comment.