$author = $this->getProfile();
if ($author->hasRole(Profile_role::SILENCED)) {
- if (empty($profile) || !$profile->hasRole(Profile_role::MODERATOR)) {
+ if (empty($profile) || !$profile->hasRight(Right::REVIEWSPAM)) {
return true;
}
}
case Right::SILENCEUSER:
case Right::DELETEUSER:
case Right::DELETEGROUP:
+ case Right::TRAINSPAM:
+ case Right::REVIEWSPAM:
$result = $this->hasRole(Profile_role::MODERATOR);
break;
case Right::CONFIGURESITE:
if (common_config('notice', 'hidespam')) {
if ($this->streamProfile->hasRole(Profile_role::SILENCED) &&
- (empty($this->userProfile) || !$this->userProfile->hasRole(Profile_role::MODERATOR))) {
+ (empty($this->userProfile) || !$this->userProfile->hasRight(Right::REVIEWSPAM))) {
return true;
}
}
const CREATEGROUP = 'creategroup';
const WEBLOGIN = 'weblogin';
const API = 'api';
+ const REVIEWSPAM = 'reviewspam';
+ const TRAINSPAM = 'trainspam';
}
*/
class ModHelperPlugin extends Plugin
{
+ static $rights = array(Right::SILENCEUSER, Right::TRAINSPAM, Right::REVIEWSPAM);
+
function onPluginVersion(&$versions)
{
$versions[] = array('name' => 'ModHelper',
function onUserRightsCheck($profile, $right, &$result)
{
- if ($right == Right::SILENCEUSER) {
+ if (in_array($right, self::$rights)) {
// Hrm.... really we should confirm that the *other* user isn't privleged. :)
if ($profile->hasRole('modhelper')) {
$result = true;