linagora / tmail-backend

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

[TeamMailbox] Refactor webadmin routes on team mailbox member management #1086

Closed Arsnael closed 1 week ago

Arsnael commented 4 weeks ago

Refactor webadmin routes on team mailbox member management to take into account the new role field of a member. Reminder that the role of a manager is symbolized by the user getting the right a on the tyeam mailbox.

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
curl -XPUT http://ip:port/domains/domain.tld/team-mailboxes/marketing/members/bob@domain.tld?role=member

Absence of the query param role will default to current behavior, adding a user with role member to the team mailbox.

Refactor as well the tests, and the tests should pass with the new model

Dont forget to readapt the webadmin doc in consequence as well

quantranhong1999 commented 4 weeks ago

We need webadmin docs changes too.

hungphan227 commented 1 week ago

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