You've already forked AstralRinth
forked from didirus/AstralRinth
Org fixes (#850)
* Org fixes * payouts bug * Update dockerfile fix test * Update to bookworm * clippy
This commit is contained in:
@@ -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(
|
||||
¤t_user.role,
|
||||
&member.clone(),
|
||||
|
||||
Reference in New Issue
Block a user