linagora / tmail-backend

GNU Affero General Public License v3.0
30 stars 17 forks source link

[TeamMailbox] Members/set JMAP method #1090

Open Arsnael opened 3 weeks ago

Arsnael commented 3 weeks ago

Request:

[
    "Members/set",
    {
        "accountId": "xyz",
        "update": {
            "team-mailbox-name"; {
                "member/cedric@domain.tld": {"role":"member"},
                "member/alice@domain.tld": null
            }
        }
    }
    "#0
]   

Response:

[
    "Members/set",
    {
        "updated": {
            "team-mailbox-name": null
        }
    },
    "#0
]

Notes:

DoD: Integration tests

chibenwa commented 3 weeks ago

a manager can't promote/unpromote other managers, it can only add/remove members

If you have a right in theory you can act as the owner thus promoting other people too, at least considering IMAP.

I think we could start implementing it this way...

Second question as a member can I use this to remove me from the team mailbox? (leave?)

quantranhong1999 commented 3 weeks ago

Second question as a member can I use this to remove me from the team mailbox? (leave?)

It sounds like the same use case of TeamMailbox/revokeAccess (Allows user to revoke his access to a team mailbox which he is part of without having to ask an admin to do such an action.)

Arsnael commented 3 weeks ago

Second question as a member can I use this to remove me from the team mailbox? (leave?)

There is already a jmap method for that, the TeamMailbox/revokeAccess method?

If you have a right in theory you can act as the owner thus promoting other people too, at least considering IMAP.

I don't know, that could lead to abuses out of webadmin control..? I'm not too sure for this case

chibenwa commented 3 weeks ago

Well the use case is allow to promote other managers without bothering the admin. Similar to gitlab...

There is already a jmap method for that, the TeamMailbox/revokeAccess method?

Very true. Sorry I forgot...

Arsnael commented 3 weeks ago

Well the use case is allow to promote other managers without bothering the admin.

Ok. We agree it shouldnt be able to unpromote though right?

chibenwa commented 3 weeks ago

Ok. We agree it shouldnt be able to unpromote though right?

Unsure, we can start by forbiding unpromote first.

hungphan227 commented 4 days ago

@Arsnael is this api used to update multiple team mailboxes at once?

Arsnael commented 4 days ago

By jmap /set method definition, yes. He needs to be manager of all the mailboxes being updated though

hungphan227 commented 4 hours ago

pr https://github.com/linagora/tmail-backend/pull/1114