Permalink
Browse files

Merge pull request #17 from DomingoLlanes/patch-1

Completed command with permission changes
  • Loading branch information...
2 parents a4f995a + 0d4a571 commit 580fc8cc25a1639683c084c8a059e155f8ac75dc @PSF1 committed on GitHub Jan 3, 2017
Showing with 21 additions and 3 deletions.
  1. +21 −3 bin/menu/mnuAdd.php
View
@@ -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' => 'menu',
+ 'nid' => $respAddNode['nid'],
+ 'flags' => '3908'
+ ));
+
+ if($respChmodNode['ok'] === FALSE)
+ {
+ return $respChmodNode;
+ }
+ }
+
+ return $respAddNode;
}
public static function getHelp() {
@@ -133,4 +151,4 @@ public static function getAccess($ignore = "") {
// }
}
}
-return new commandMnuAdd();
+return new commandMnuAdd();

0 comments on commit 580fc8c

Please sign in to comment.