diff --git a/doc/06-Security.md b/doc/06-Security.md index 64bf37685..e0848f405 100644 --- a/doc/06-Security.md +++ b/doc/06-Security.md @@ -216,13 +216,13 @@ results of this query instead: #### Username placeholder -The string `$currentUser` is replaced by the local username (without the domain part) of the logged on user while evaluating restrictions. +The string `$user:local_name$` is replaced by the local username (without the domain part) of the logged on user while evaluating restrictions. This can come in handy if you have some kind of attribute on host or service level defining which user is responsible for a certain host or service. -#### Example : +**Example** ``` -monitoring/filter/objects = (__responsible=$currentUser$|__deputy=$currentUser$) +monitoring/filter/objects = (_responsible=$user:local_name$|_deputy=$user:local_name$) ``` #### Stacking Filters diff --git a/library/Icinga/User.php b/library/Icinga/User.php index 5374d3d9e..0d237831d 100644 --- a/library/Icinga/User.php +++ b/library/Icinga/User.php @@ -253,7 +253,7 @@ class User public function setRestrictions(array $restrictions) { foreach ($restrictions as $name => $restriction) { - $restrictions[$name] = str_replace('$currentUser$', $this->getLocalUsername(), $restriction); + $restrictions[$name] = str_replace('$user:local_name$', $this->getLocalUsername(), $restriction); } $this->restrictions = $restrictions;