From 34eadb7f294cb4709a028cc3c473042fb595acbb Mon Sep 17 00:00:00 2001 From: Oliver Rahner Date: Wed, 8 Aug 2018 15:15:02 +0200 Subject: [PATCH] Enable `$currentUser` placeholder in restrictions implements #3493 --- library/Icinga/User.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/Icinga/User.php b/library/Icinga/User.php index c96bace1c..5374d3d9e 100644 --- a/library/Icinga/User.php +++ b/library/Icinga/User.php @@ -252,6 +252,10 @@ class User */ public function setRestrictions(array $restrictions) { + foreach ($restrictions as $name => $restriction) { + $restrictions[$name] = str_replace('$currentUser$', $this->getLocalUsername(), $restriction); + } + $this->restrictions = $restrictions; return $this; }