SMQ-2601 - Remove user from domain#3323
Open
felixgateru wants to merge 3 commits intoabsmach:mainfrom
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3323 +/- ##
==========================================
+ Coverage 74.83% 80.87% +6.04%
==========================================
Files 160 105 -55
Lines 18890 13215 -5675
==========================================
- Hits 14136 10688 -3448
+ Misses 3904 1869 -2035
+ Partials 850 658 -192 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3ae195c to
20f24a7
Compare
arvindh123
requested changes
Feb 2, 2026
Comment on lines
230
to
257
| func (r ProvisionManageService) RemoveMemberFromDomain(ctx context.Context, domainID, memberID string) error { | ||
| switch r.entityType { | ||
| case policies.ClientType, | ||
| policies.ChannelType, | ||
| policies.GroupType: | ||
| role, err := r.repo.RetrieveRoleByDomainMember(ctx, domainID, memberID) | ||
| if err != nil { | ||
| return errors.Wrap(svcerr.ErrRemoveEntity, err) | ||
| } | ||
|
|
||
| pr := policies.Policy{ | ||
| ObjectType: policies.RoleType, | ||
| Object: role, | ||
| SubjectType: policies.UserType, | ||
| } | ||
|
|
||
| if err := r.policy.DeletePolicyFilter(ctx, pr); err != nil { | ||
| return errors.Wrap(svcerr.ErrDeletePolicies, err) | ||
| } | ||
|
|
||
| if err := r.repo.RemoveMemberFromDomain(ctx, domainID, memberID); err != nil { | ||
| return err | ||
| } | ||
| return nil | ||
| default: | ||
| return errInvalidOperation | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
This should be generic, so that it should work with MG
20f24a7 to
d340a32
Compare
arvindh123
requested changes
Feb 4, 2026
|
|
||
| RemoveEntityMembers(ctx context.Context, session authn.Session, entityID string, members []string) (err error) | ||
|
|
||
| RemoveMemberFromDomain(ctx context.Context, domainID, memberID string) error |
Contributor
There was a problem hiding this comment.
We could not have this RemoveMemberFromDomain because this have logic related to particular entity domain.
We should handle this via Entity Event Consumers ( for example in clients, channels, groups service , where it consumes domain delete event)
0113d25 to
2a2f384
Compare
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
2a2f384 to
16fd2fb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
This is a feature because it enables a user to be removed from a domain
What does this do?
This pr:
Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
No
Did you document any new/modified feature?
No
Notes