-
Notifications
You must be signed in to change notification settings - Fork 672
SMQ-2609 - Enable superadmin to perform actions over entities #2688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2688 +/- ##
==========================================
+ Coverage 27.53% 27.58% +0.04%
==========================================
Files 351 219 -132
Lines 55379 44701 -10678
==========================================
- Hits 15251 12332 -2919
+ Misses 39372 31775 -7597
+ Partials 756 594 -162 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7512024
to
47452d5
Compare
@arvindh123 @felixgateru What's the status of this PR? |
domains/middleware/authorization.go
Outdated
@@ -141,8 +150,7 @@ func (am *authorizationMiddleware) ListDomains(ctx context.Context, session auth | |||
} | |||
|
|||
func (am *authorizationMiddleware) SendInvitation(ctx context.Context, session authn.Session, invitation domains.Invitation) (err error) { | |||
domainUserId := auth.EncodeDomainUserID(invitation.DomainID, invitation.InviteeUserID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Invitations related authz middleware functions are removed ?
0f04178
to
f9e1685
Compare
journal/middleware/authorization.go
Outdated
@@ -39,7 +39,7 @@ func (am *authorizationMiddleware) RetrieveAll(ctx context.Context, session smqa | |||
permission := readPermission | |||
objectType := page.EntityType.String() | |||
object := page.EntityID | |||
subject := session.DomainUserID | |||
subject := session.Subject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this was changed to Subject
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to Subject as it can be just the userID or the domainUserId. Should I revert this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DomainUserID means id of user within the domain, which is different from actual user id for platform ,
In each domain, user should have unquie id .
So just we are adding prefix domain_id to user id to get the unqiue user id for user per domain , which is called domain user id
b0ae01d
to
ec39e29
Compare
d97fe33
to
6c72b27
Compare
c48025d
to
c9423f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arvindh123 Please re-review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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>
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>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
…ct in auth key Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
What type of PR is this?
This is a refactor as it remove DomainUserID encoding.
What does this do?
This pr removes DomainUserID encodinh and makes all authorization on entities to be performed with userID.
Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
Yes, I have updated tests.
Did you document any new/modified feature?
No,
Notes
None