mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 10:12:41 +01:00
Add serious business string for defrocking a user (remove admin rights)
Summary: Allow humans to understand what happened when `phabricator.serious-business` mode is enabled: The administrator role was removed from a user account. Closes T15480 Test Plan: Enable `phabricator.serious-business` mode. Enable and disable an account as admin. Check that account's feed and the general feed. Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15480 Differential Revision: https://we.phorge.it/D25298
This commit is contained in:
parent
c300f0e874
commit
478012cd46
1 changed files with 20 additions and 7 deletions
|
@ -55,12 +55,18 @@ final class PhabricatorUserEmpowerTransaction
|
||||||
return pht(
|
return pht(
|
||||||
'%s empowered this user as an administrator.',
|
'%s empowered this user as an administrator.',
|
||||||
$this->renderAuthor());
|
$this->renderAuthor());
|
||||||
|
} else {
|
||||||
|
if (PhabricatorEnv::getEnvConfig('phabricator.serious-business')) {
|
||||||
|
return pht(
|
||||||
|
'%s removed the administrator role from this user.',
|
||||||
|
$this->renderAuthor());
|
||||||
} else {
|
} else {
|
||||||
return pht(
|
return pht(
|
||||||
'%s defrocked this user.',
|
'%s defrocked this user.',
|
||||||
$this->renderAuthor());
|
$this->renderAuthor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getTitleForFeed() {
|
public function getTitleForFeed() {
|
||||||
$new = $this->getNewValue();
|
$new = $this->getNewValue();
|
||||||
|
@ -69,6 +75,12 @@ final class PhabricatorUserEmpowerTransaction
|
||||||
'%s empowered %s as an administrator.',
|
'%s empowered %s as an administrator.',
|
||||||
$this->renderAuthor(),
|
$this->renderAuthor(),
|
||||||
$this->renderObject());
|
$this->renderObject());
|
||||||
|
} else {
|
||||||
|
if (PhabricatorEnv::getEnvConfig('phabricator.serious-business')) {
|
||||||
|
return pht(
|
||||||
|
'%s removed the administrator role from %s.',
|
||||||
|
$this->renderAuthor(),
|
||||||
|
$this->renderObject());
|
||||||
} else {
|
} else {
|
||||||
return pht(
|
return pht(
|
||||||
'%s defrocked %s.',
|
'%s defrocked %s.',
|
||||||
|
@ -76,6 +88,7 @@ final class PhabricatorUserEmpowerTransaction
|
||||||
$this->renderObject());
|
$this->renderObject());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getRequiredCapabilities(
|
public function getRequiredCapabilities(
|
||||||
$object,
|
$object,
|
||||||
|
|
Loading…
Reference in a new issue