Admin can override moderators

merge-requests/30/head
Bob Mottram 2020-12-17 09:50:04 +00:00
parent 75fb7c4f03
commit c5c8be599a
1 changed files with 5 additions and 2 deletions

View File

@ -12,6 +12,7 @@ from petnames import getPetName
from person import isPersonSnoozed from person import isPersonSnoozed
from posts import isModerator from posts import isModerator
from utils import getFullDomain from utils import getFullDomain
from utils import getConfigParam
from utils import isDormant from utils import isDormant
from utils import removeHtml from utils import removeHtml
from utils import getDomainFromActor from utils import getDomainFromActor
@ -183,8 +184,10 @@ def htmlPersonOptions(defaultTimeline: str,
# checkbox for permission to post to newswire # checkbox for permission to post to newswire
if optionsDomainFull == domainFull: if optionsDomainFull == domainFull:
if isModerator(baseDir, nickname) and \ adminNickname = getConfigParam(baseDir, 'admin')
not isModerator(baseDir, optionsNickname): if (nickname == adminNickname or
(isModerator(baseDir, nickname) and
not isModerator(baseDir, optionsNickname))):
newswireBlockedFilename = \ newswireBlockedFilename = \
baseDir + '/accounts/' + \ baseDir + '/accounts/' + \
optionsNickname + '@' + optionsDomain + '/.nonewswire' optionsNickname + '@' + optionsDomain + '/.nonewswire'