Org fixes (#850)

* Org fixes

* payouts bug

* Update dockerfile fix test

* Update to bookworm

* clippy
This commit is contained in:
Geometrically
2024-01-12 14:19:39 -05:00
committed by GitHub
parent 4483bb147c
commit 7b00003958
13 changed files with 129 additions and 32 deletions

View File

@@ -504,9 +504,11 @@ pub async fn add_team_member(
.as_ref()
.map(|tm| tm.is_owner)
.unwrap_or(false)
&& new_member.permissions != ProjectPermissions::all()
{
return Err(ApiError::InvalidInput(
"You cannot add the owner of an organization to a project team owned by that organization".to_string(),
"You cannot override the owner of an organization's permissions in a project team"
.to_string(),
));
}
@@ -634,6 +636,22 @@ pub async fn edit_team_member(
} else {
None
};
if organization_team_member
.as_ref()
.map(|x| x.is_owner)
.unwrap_or(false)
&& edit_member
.permissions
.map(|x| x != ProjectPermissions::all())
.unwrap_or(false)
{
return Err(ApiError::CustomAuthentication(
"You cannot override the project permissions of the organization owner!"
.to_string(),
));
}
let permissions = ProjectPermissions::get_permissions_by_role(
&current_user.role,
&member.clone(),