mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
renamed variable $currentUser$ to $user:local_name$
updated docs, too
This commit is contained in:
parent
967a0bf74e
commit
6ad74ef1cc
@ -216,13 +216,13 @@ results of this query instead:
|
|||||||
|
|
||||||
#### Username placeholder <a id="username-placeholder"></a>
|
#### Username placeholder <a id="username-placeholder"></a>
|
||||||
|
|
||||||
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.
|
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 <a id="username-placeholder-example"> </a>:
|
**Example**
|
||||||
|
|
||||||
```
|
```
|
||||||
monitoring/filter/objects = (__responsible=$currentUser$|__deputy=$currentUser$)
|
monitoring/filter/objects = (_responsible=$user:local_name$|_deputy=$user:local_name$)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Stacking Filters <a id="stacking-filters"></a>
|
#### Stacking Filters <a id="stacking-filters"></a>
|
||||||
|
@ -253,7 +253,7 @@ class User
|
|||||||
public function setRestrictions(array $restrictions)
|
public function setRestrictions(array $restrictions)
|
||||||
{
|
{
|
||||||
foreach ($restrictions as $name => $restriction) {
|
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;
|
$this->restrictions = $restrictions;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user