Closed quantranhong1999 closed 2 weeks ago
TeamMailboxRepository needs to be acknowledged about member role (manager / member) now.
TeamMailboxRepository
manager
member
Introduce a TeamMailboxMember POJO = Username + MemberRole (could be an enum)
TeamMailboxMember
Username
MemberRole
Refactor the TeamMailboxRepository API to use TeamMailboxMember instead of Username:
def addMember(teamMailbox: TeamMailbox, addUser: TeamMailboxMember): Publisher[Void] def removeMember(teamMailbox: TeamMailbox, removeUser: TeamMailboxMember): Publisher[Void] def listMembers(teamMailbox: TeamMailbox): Publisher[TeamMailboxMember]
If manager role, we add the a right for that user. Otherwise we keep it the same as today.
a
Upon getting a member, we can use RightManager.hasRightReactive to see if the user is a manager.
RightManager.hasRightReactive
Adapt the contract tests to cover the cases.
Pass contract tests.
https://github.com/linagora/tmail-backend/pull/1098
Why
TeamMailboxRepository
needs to be acknowledged about member role (manager
/member
) now.How
Introduce a
TeamMailboxMember
POJO =Username
+MemberRole
(could be an enum)Refactor the
TeamMailboxRepository
API to useTeamMailboxMember
instead ofUsername
:If
manager
role, we add thea
right for that user. Otherwise we keep it the same as today.Upon getting a member, we can use
RightManager.hasRightReactive
to see if the user is amanager
.Adapt the contract tests to cover the cases.
DoD
Pass contract tests.