Revert "fix behaviour for delete/expunge, when lacking rights"

This reverts commit c305d63e00.

Zak Smith reported it continued to be a problem
This commit is contained in:
John Goerzen 2008-03-04 08:13:48 -06:00
parent 4c56514381
commit cabd8d1735

View File

@ -424,17 +424,12 @@ class IMAPFolder(BaseFolder):
self.addmessagesflags_noconvert(uidlist, ['T']) self.addmessagesflags_noconvert(uidlist, ['T'])
imapobj = self.imapserver.acquireconnection() imapobj = self.imapserver.acquireconnection()
try: try:
# Making sure, that we have the necessary rights try:
# ensuring that we access readonly: python's braindead imaplib.py imapobj.select(self.getfullname())
# otherwise might raise an exception during the myrights() call except imapobj.readonly:
imapobj.select(self.getfullname(),readonly=1)
if not 'd' in imapobj.myrights(self.getfullname())[1][0].split()[1]:
# no delete/expunge rights
UIBase.getglobalui().deletereadonly(self, uidlist) UIBase.getglobalui().deletereadonly(self, uidlist)
return return
if self.expunge: if self.expunge:
imapobj.select(self.getfullname())
assert(imapobj.expunge()[0] == 'OK') assert(imapobj.expunge()[0] == 'OK')
finally: finally:
self.imapserver.releaseconnection(imapobj) self.imapserver.releaseconnection(imapobj)