Skip to content
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

Multiple project owner backend #4774

Merged
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
78b82ab
Modified db schema of Owner.
aryan-bhokare Mar 17, 2024
962175b
Added new API GetProjectOwners.
aryan-bhokare Mar 17, 2024
0c8528e
fix: return type error.
aryan-bhokare Mar 17, 2024
aeb1085
chore(deps): Bump golang.org/x/crypto in /chaoscenter/authentication …
dependabot[bot] Mar 21, 2024
64867b8
chore(deps): Bump follow-redirects in /chaoscenter/web (#4529)
dependabot[bot] Mar 21, 2024
eacb880
chore(deps): Bump github.com/golang/protobuf (#4493)
dependabot[bot] Mar 22, 2024
1de73da
Modified SendInvitation API.
aryan-bhokare Mar 23, 2024
7c79813
Modified LeaveProject API.
aryan-bhokare Mar 23, 2024
44ae3b9
RBAC modification `LeaveProject`.
aryan-bhokare Mar 24, 2024
77bcd91
Added `UpdateMemberRole` API.
aryan-bhokare Mar 24, 2024
43bd3b2
Fixed some syntax errors.
aryan-bhokare Apr 5, 2024
2ac9f7d
Updated roles for owner.
aryan-bhokare Apr 5, 2024
1860721
Added new API `DeleteProject`.
aryan-bhokare Apr 9, 2024
a2a27d4
Added mocks.
aryan-bhokare Apr 9, 2024
4e8279a
Merge branch 'multiple-owner-support' into multiple-project-owner-bac…
aryan-bhokare Apr 9, 2024
737c03f
modified go.sum
aryan-bhokare Apr 9, 2024
c1b2ed3
Added condition `UpdateMemberRole`.
aryan-bhokare Apr 10, 2024
197aabd
made suggested changes.
aryan-bhokare Apr 10, 2024
4a10fe3
Changed DeleteProject endpoint to have url parameter.
aryan-bhokare Apr 11, 2024
33dec51
Minor fixes.
aryan-bhokare Apr 11, 2024
0fe519a
Merge branch 'master' into multiple-project-owner-backend
aryan-bhokare Jul 18, 2024
f7062d5
fixed import orders
aryan-bhokare Jul 18, 2024
a381cb4
fixing RoleEditor to RoleExecuter
aryan-bhokare Jul 18, 2024
6427568
Merge branch 'master' into multiple-project-owner-backend
Saranya-jena Jul 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added condition UpdateMemberRole.
User cannot change role of their own, so that it will avoid edge cases like
1. User is the last owner of the project.
2. User accidentally losing owner access to the projects.

Signed-off-by: aryan <aryan1bhokare@gmail.com>
aryan-bhokare committed Apr 10, 2024
commit c1b2ed3542e45df138a8bc93629810c05fc00327
Original file line number Diff line number Diff line change
@@ -798,7 +798,13 @@ func UpdateMemberRole(service services.ApplicationService) gin.HandlerFunc {
presenter.CreateErrorResponse(utils.ErrUnauthorized))
return
}


uid := c.MustGet("uid").(string)
if uid == member.UserID {
c.JSON(http.StatusBadRequest, gin.H{"message": "User cannot change his own role."})
return
}

err = service.UpdateMemberRole(member.ProjectID, member.UserID, member.Role)
if err != nil {
log.Error(err)