Enable `$currentUser` placeholder in restrictions

implements #3493
This commit is contained in:
Oliver Rahner 2018-08-08 15:15:02 +02:00 committed by GitHub
parent b3e0b5d587
commit 34eadb7f29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}