Patch #998149: imaplib deleteacl and myrights.

This commit is contained in:
Martin v. Löwis 2004-07-27 05:07:19 +00:00
parent 5785a1391e
commit 7b9190b8fc
4 changed files with 26 additions and 0 deletions

View File

@ -182,6 +182,10 @@ data = authobject(response)
Delete old mailbox named \var{mailbox}. Delete old mailbox named \var{mailbox}.
\end{methoddesc} \end{methoddesc}
\begin{methoddesc}{deleteacl}{mailbox, who}
Delete the ACLs (remove any rights) set for who on mailbox.
\end{methoddesc}
\begin{methoddesc}{expunge}{} \begin{methoddesc}{expunge}{}
Permanently remove deleted items from selected mailbox. Generates an Permanently remove deleted items from selected mailbox. Generates an
\samp{EXPUNGE} response for each deleted message. Returned data \samp{EXPUNGE} response for each deleted message. Returned data
@ -242,6 +246,10 @@ data = authobject(response)
Returned data are tuples of message part envelope and data. Returned data are tuples of message part envelope and data.
\end{methoddesc} \end{methoddesc}
\begin{methoddes}{myrights}{mailbox}
Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).
\end{methoddesc}
\begin{methoddesc}{namespace}{} \begin{methoddesc}{namespace}{}
Returns IMAP namespaces as defined in RFC2342. Returns IMAP namespaces as defined in RFC2342.
\versionadded{2.3} \versionadded{2.3}

View File

@ -46,12 +46,14 @@ Commands = {
'COPY': ('SELECTED',), 'COPY': ('SELECTED',),
'CREATE': ('AUTH', 'SELECTED'), 'CREATE': ('AUTH', 'SELECTED'),
'DELETE': ('AUTH', 'SELECTED'), 'DELETE': ('AUTH', 'SELECTED'),
'DELETEACL': ('AUTH', 'SELECTED'),
'EXAMINE': ('AUTH', 'SELECTED'), 'EXAMINE': ('AUTH', 'SELECTED'),
'EXPUNGE': ('SELECTED',), 'EXPUNGE': ('SELECTED',),
'FETCH': ('SELECTED',), 'FETCH': ('SELECTED',),
'GETACL': ('AUTH', 'SELECTED'), 'GETACL': ('AUTH', 'SELECTED'),
'GETQUOTA': ('AUTH', 'SELECTED'), 'GETQUOTA': ('AUTH', 'SELECTED'),
'GETQUOTAROOT': ('AUTH', 'SELECTED'), 'GETQUOTAROOT': ('AUTH', 'SELECTED'),
'MYRIGHTS': ('AUTH', 'SELECTED'),
'LIST': ('AUTH', 'SELECTED'), 'LIST': ('AUTH', 'SELECTED'),
'LOGIN': ('NONAUTH',), 'LOGIN': ('NONAUTH',),
'LOGOUT': ('NONAUTH', 'AUTH', 'SELECTED', 'LOGOUT'), 'LOGOUT': ('NONAUTH', 'AUTH', 'SELECTED', 'LOGOUT'),
@ -389,6 +391,12 @@ class IMAP4:
""" """
return self._simple_command('DELETE', mailbox) return self._simple_command('DELETE', mailbox)
def deleteacl(self, mailbox, who):
"""Delete the ACLs (remove any rights) set for who on mailbox.
(typ, [data]) = <instance>.deleteacl(mailbox, who)
"""
return self._simple_command('DELETEACL', mailbox, who)
def expunge(self): def expunge(self):
"""Permanently remove deleted items from selected mailbox. """Permanently remove deleted items from selected mailbox.
@ -518,6 +526,13 @@ class IMAP4:
typ, dat = self._simple_command(name, directory, pattern) typ, dat = self._simple_command(name, directory, pattern)
return self._untagged_response(typ, dat, name) return self._untagged_response(typ, dat, name)
def myrights(self, mailbox):
"""Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).
(typ, [data]) = <instance>.myrights(mailbox)
"""
typ,dat = self._simple_command('MYRIGHTS', mailbox)
return self._untagged_response(typ, dat, 'MYRIGHTS')
def namespace(self): def namespace(self):
""" Returns IMAP namespaces ala rfc2342 """ Returns IMAP namespaces ala rfc2342

View File

@ -328,6 +328,7 @@ Holger Krekel
Hannu Krosing Hannu Krosing
Andrew Kuchling Andrew Kuchling
Vladimir Kushnir Vladimir Kushnir
Arnaud Mazin
Cameron Laird Cameron Laird
Tino Lange Tino Lange
Andrew Langmead Andrew Langmead

View File

@ -44,6 +44,8 @@ Extension modules
Library Library
------- -------
- imaplib has two new methods: deleteacl and myrights.
- nntplib has two new methods: description and descriptions. They - nntplib has two new methods: description and descriptions. They
use a more RFC-compliant way of getting a newsgroup description. use a more RFC-compliant way of getting a newsgroup description.