-
Notifications
You must be signed in to change notification settings - Fork 34
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
feat: add disable org on creation flag and disallow removing of last admin from the org/group #317
Conversation
Chief-Rishab
commented
Sep 1, 2023
•
edited
Loading
edited
- Disable org on creation flag added.
- Org APIs now accepts both org name and uuid. Have added checks to prevent actions on disabled orgs
- Additionally a check to prevent the last org admin and project owner to be removed. Another user must be given these permissions before removing that user
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
6d3a906
to
2d224c4
Compare
5fbf9e9
to
be7cbb1
Compare
56944a2
to
1822bab
Compare
1822bab
to
43d87a2
Compare
43d87a2
to
7de3577
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.
Left some minor comments rest LGTM
b62d94a
to
92c5e60
Compare
internal/api/v1beta1/group.go
Outdated
logger.Error(err.Error()) | ||
return nil, grpcInternalServerError | ||
} | ||
if len(owners) == 1 { |
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.
Hey where do we check the user we are trying to remove is part of owners list? This would fail the call if I am just removing a random user as well right if we have 1 owner?
internal/api/v1beta1/group.go
Outdated
} | ||
} | ||
|
||
owners, err := h.userService.ListByGroup(ctx, request.GetId(), schema.OwnerRelationName) |
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.
Have you tested this with schema.OwnerRelationName
. I think we should check schema.DeletePermission
instead to ensure he is the owner.
internal/api/v1beta1/org.go
Outdated
logger.Error(err.Error()) | ||
return nil, grpcInternalServerError | ||
} | ||
if len(admins) == 1 { |
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.
Same as groups, where do we check if the user being removed is actually admin?
a74896d
to
ff6d06b
Compare
ff6d06b
to
c64fe47
Compare
c64fe47
to
9d80bf0
Compare
Pull Request Test Coverage Report for Build 6125621992
💛 - Coveralls |