1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

fix(access/team): team member cannot change ownership to its own team [EE-4423] (#8052)

This commit is contained in:
Oscar Zhou 2022-12-15 21:27:18 +13:00 committed by GitHub
parent 37896661d6
commit b22cdb3559
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View file

@ -109,6 +109,12 @@ export function EditDetails({
if (ownership === ResourceControlOwnership.RESTRICTED) {
authorizedUsers = [];
authorizedTeams = [];
// Non admin team leaders/members under only one team can
// automatically grant the resource access to all members
// under the team
if (!isAdmin && teams && teams.length === 1) {
authorizedTeams = teams.map((team) => team.Id);
}
}
handleChange({ ownership, authorizedTeams, authorizedUsers });