mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Allow global maintainer to transfer hosts between Teams (#1243)
Reclassify these operations as "host write" to apply the appropriate permissions. Fixes #1237
This commit is contained in:
parent
c8c5e0db56
commit
959c1fda81
1 changed files with 2 additions and 2 deletions
|
|
@ -130,7 +130,7 @@ func (svc Service) AddHostsToTeam(ctx context.Context, teamID *uint, hostIDs []u
|
|||
// besides global admins permissions to modify team hosts, we will need to
|
||||
// check that the user has permissions for both the source and destination
|
||||
// teams.
|
||||
if err := svc.authz.Authorize(ctx, &fleet.Team{}, fleet.ActionWrite); err != nil {
|
||||
if err := svc.authz.Authorize(ctx, &fleet.Host{}, fleet.ActionWrite); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ func (svc Service) AddHostsToTeamByFilter(ctx context.Context, teamID *uint, opt
|
|||
// besides global admins permissions to modify team hosts, we will need to
|
||||
// check that the user has permissions for both the source and destination
|
||||
// teams.
|
||||
if err := svc.authz.Authorize(ctx, &fleet.Team{}, fleet.ActionWrite); err != nil {
|
||||
if err := svc.authz.Authorize(ctx, &fleet.Host{}, fleet.ActionWrite); err != nil {
|
||||
return err
|
||||
}
|
||||
vc, ok := viewer.FromContext(ctx)
|
||||
|
|
|
|||
Loading…
Reference in a new issue