diff --git a/library/Icinga/Web/Menu.php b/library/Icinga/Web/Menu.php index 8d62563be..872fd3249 100644 --- a/library/Icinga/Web/Menu.php +++ b/library/Icinga/Web/Menu.php @@ -75,6 +75,17 @@ class Menu implements RecursiveIterator */ protected $parent; + /** + * Permission a user is required to have granted to display the menu item + * + * If a permission is set, authentication is of course required. + * + * Note that only one required permission can be set yet. + * + * @var string|null + */ + protected $permission; + /** * Create a new menu * @@ -442,15 +453,27 @@ class Menu implements RecursiveIterator } /** - * Set required Permissions + * Get the permission a user is required to have granted to display the menu item * - * @param $permission + * @return string|null + */ + public function getPermission() + { + return $this->permission; + } + + /** + * Set permission a user is required to have granted to display the menu item + * + * If a permission is set, authentication is of course required. + * + * @param string $permission * * @return $this */ - public function requirePermission($permission) + public function setPermission($permission) { - // Not implemented yet + $this->permission = (string) $permission; return $this; }