Closed Bug 522342 Opened 15 years ago Closed 15 years ago

Allow JS/UI code to list other users with access to the folder (list full ACL)

Categories

(MailNews Core :: Networking: IMAP, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0rc1

People

(Reporter: BenB, Assigned: BenB)

Details

(Keywords: fixed-seamonkey2.0.1)

Attachments

(2 files, 3 obsolete files)

I'd like to list the whole access list (ACL) of a folder in the folder properties dialog, including which other users have access to this folder and which rights each has.

We have this information in the backend, we just don't use it and don't have an IDL for it. This bug asks to implement that.

Attaching patch.
Attached patch Fix, v1 (obsolete) — Splinter Review
Attachment #406295 - Flags: review?(bienvenu)
Comment on attachment 406295 [details] [diff] [review]
Fix, v1

looks good in general.

need to rev the uuid.

+   * List all (human) users apart from the current user which have access to

s/which/who

+   * this folder. (List is not guaranteed to be complete.)

When will the list not be complete?
> need to rev the uuid.

Done

> s/which/who

Done

> > (List is not guaranteed to be complete.)
> When will the list not be complete?

I don't know. I just didn't know whether the code guarantees it. I can remove that sentence.
Done

I also revised the description of the permission flags.
Attached patch Fix, v2 (obsolete) — Splinter Review
Fixed above feedback.

I had to do a full rebuild (because of the uuid rev) - make clean && make in mailnews/ and mail/ were not sufficient :(.
Attachment #406295 - Attachment is obsolete: true
Attachment #406325 - Flags: review?(bienvenu)
Attachment #406295 - Flags: review?(bienvenu)
(before that, I got XPCOM errors when calling the new functions)
make -s tier_app in the obj-dir always does the trick for me...
Comment on attachment 406325 [details] [diff] [review]
Fix, v2

the patch is bit-rotted - it seems to have been made against a slightly out of date tree.

these two lines are a bit long - can you wrap them?

+static PLDHashOperator fillArrayWithKeys(const nsACString& key, const nsCString data, void* userArg)

+nsresult nsImapMailFolder::GetOtherUsersWithAccess(nsIUTF8StringEnumerator** aResult)

this needs to be NS_IMETHODIMP, not nsresult:

+nsresult nsImapMailFolder::GetPermissionsForUser(const nsACString& otherUser, nsACString& aResult)

r=me, with those fixed.
Attachment #406325 - Flags: review?(bienvenu) → review+
Attachment #406325 - Flags: superreview?(bienvenu)
Attachment #406325 - Flags: approval-thunderbird3?
Attachment #406572 - Flags: superreview?(bienvenu)
Attachment #406572 - Flags: approval-thunderbird3?
Attachment #406325 - Attachment is obsolete: true
Attachment #406325 - Flags: superreview?(bienvenu)
Attachment #406325 - Flags: approval-thunderbird3?
Comment on attachment 406572 [details] [diff] [review]
Fix, v3 - new fresh yummy yummy, up-to-date to trunk

this still needs to be NS_IMETHODIMP

+nsresult nsImapMailFolder::GetOtherUsersWithAccess(nsIUTF8StringEnumerator** aResult)

and this should be wrapped:

+static PLDHashOperator fillArrayWithKeys(const nsACString& key, const nsCString data, void* userArg)


sr/a=me, with those comments addressed.
Attachment #406572 - Flags: superreview?(bienvenu)
Attachment #406572 - Flags: superreview+
Attachment #406572 - Flags: approval-thunderbird3?
Attachment #406572 - Flags: approval-thunderbird3+
Attached patch Fix, v4Splinter Review
Ops, sorry. Fixed.
Attachment #406572 - Attachment is obsolete: true
Commited http://hg.mozilla.org/comm-central/rev/81f036d91636

Thunderbird on mozilla-central trunk
http://tinderbox.mozilla.org/showbuilds.cgi?tree=Thunderbird
is burning, though, because somebody decided to remove nsCStringArray (I just followed https://developer.mozilla.org/en/XPCOM_array_guide ).
Thunderbird 3.0 on Mozilla 1.9.1 is fine
http://build.mozillamessaging.com/tinderboxpushlog/?tree=Thunderbird3.0
so I'll care about this tomorrow.
(In reply to comment #11)
> so I'll care about this tomorrow.

Please, at least, tag the (SM & TB) builds...
Status: NEW → ASSIGNED
Fixed, hopefully, in http://hg.mozilla.org/comm-central/rev/5b94dffb67e4

The NS_NewAdoptingUTF8StringEnumerator() API changed its second parameter from nsCStringArray in 1.9.1 to nsTArray<nsCString> in m-c, so I used an #ifdef.
The bustage fix was incomplete, I need to adapt the cast to the new array type as well. Without this patch, this causes TB on m-c to crash when accessing the new functions added here.
Attachment #406677 - Flags: review?
Attachment #406677 - Flags: review? → review?(bugzilla)
Attachment #406677 - Flags: superreview+
Attachment #406677 - Flags: review?(bugzilla)
Attachment #406677 - Flags: review+
Attachment #406677 - Flags: approval-thunderbird3+
Comment on attachment 406677 [details] [diff] [review]
Fix crash in TB on m-c

Sorry, I meant http://hg.mozilla.org/comm-central/rev/b887790ca1f2
FIXED
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 3.0rc1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: