linagora / tmail-backend

GNU Affero General Public License v3.0
39 stars 21 forks source link

[STORY] As an admin I want to delegate team mailbox management to a user #894

Closed chibenwa closed 2 months ago

chibenwa commented 8 months ago

User story

Team mailbox manager

As an admin I can promote 0-n team mailbox members as manager (using webadmin).

Technically those team mailbox members are identified via the right a.

All team mailbox members can see other members

As a team mailbox member in team mailbox properties, I can see the list of other users that can access the team mailbox.

Note that all members sees if other members are managers or not.

Team mailbox managers rights

A team mailbox manager can add/remove regular members.

In a V1 of team mailbox management, team mailbox mamager cannot promote/unpromote other team mailbox manager / himself (forbidden to touch right a.

Technically:

curl -XGET http://ip:port/domains/domain.tld/team-mailboxes/marketting/members

[
  {
     "username": "bob@domain.tld",
     "role": "manager"
  },
  {
     "username": "alice@domain.tld",
     "role": "member"
  },
...
]
curl -XPUT http://ip:port/domains/domain.tld/team-mailboxes/marketing/members/bob@domain.tld?role=manager

(Same as create member)

curl -XPUT http://ip:port/domains/domain.tld/team-mailboxes/marketing/members/bob@domain.tld?role=member

(Same as create member)

[
    "Members/get",
    {
        "accountId": "xyz",
        "ids": ["id-of-any-mailbox-belonging-to-the-team-mailbox"]
    },
    "#0
]    

=> 
[
    "Members/get",
    {
        "list": [{
            "id": "id-of-any-mailbox-belonging-to-the-team-mailbox",
            "members": {
                "bob@domain.tld": {"role":"manager"},
                "alice@domain.tld": {"role":"member"}
             }
         }]
    },
    "#0
}
[
    "Members/set",
    {
        "accountId": "xyz",
        "update": {
            "id-of-any-mailbox-belonging-to-the-team-mailbox"; {
                "member/cedric@domain.tld": {"role":"member"},
                "member/alice@domain.tld": null
            }
        }
    }
    "#0
]    

=> 

[
    "Members/set",
    {
        "updated": {
            "id-of-any-mailbox-belonging-to-the-team-mailbox": null
        }
    },
    "#0
}

Feedback: @dieptran88 @hoangdat @Arsnael

@dieptran88 could you create a user story for listing members of a team mailbox, and for manager to add/remove members on tmail-flutter side?

@Arsnael Good intern topic?

Arsnael commented 8 months ago

@chibenwa looks good to me. This kind of topic looks good as an intern topic indeed

Arsnael commented 4 months ago

The way I would see it, nothing too big:

vttranlina commented 4 months ago

Should we allow full reset as well?

what is "full reset"?

quantranhong1999 commented 4 months ago

what is "full reset"?

set (fully) update (not partial update) I think

hungphan227 commented 4 months ago

no full reset for now => complicated with case cannot promote/unpromote managers

hungphan227 commented 4 months ago

How can we resolve the "teamMailboxId" e.g. "id": "id-of-any-mailbox-belonging-to-the-team-mailbox" to the actual team maibox name? Given that today our TeamMailboxRepository relies on TeamMailbox name.

Can we use the team mailbox name as the id? Otherwise likely we would need to do some refactoring or introduce some table mapping id -> team mailbox name?

Arsnael commented 4 months ago

Thoughts: do we need a new capability for this jmap extension?

quantranhong1999 commented 4 months ago

Thoughts: do we need a new capability for this jmap extension?

Likely yes IMO. That would help mobile team to know if it is TMail server with the team mailbox feature or just a normal JMAP server.