@@ -3,6 +3,7 @@ package service
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/fleetdm/fleet/v4/server/contexts/ctxerr"
|
||||
"github.com/fleetdm/fleet/v4/server/fleet"
|
||||
)
|
||||
|
||||
@@ -16,3 +17,18 @@ func (svc *Service) SoftwareByID(ctx context.Context, id uint, teamID *uint, _ b
|
||||
// reuse SoftwareByID, but include cve scores in premium version
|
||||
return svc.Service.SoftwareByID(ctx, id, teamID, true)
|
||||
}
|
||||
|
||||
func (svc *Service) ListFleetMaintainedApps(ctx context.Context, teamID uint, opts fleet.ListOptions) ([]fleet.MaintainedApp, *fleet.PaginationMetadata, error) {
|
||||
if err := svc.authz.Authorize(ctx, &fleet.AuthzSoftwareInventory{
|
||||
TeamID: &teamID,
|
||||
}, fleet.ActionRead); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
avail, meta, err := svc.ds.ListAvailableFleetMaintainedApps(ctx, teamID, opts)
|
||||
if err != nil {
|
||||
return nil, nil, ctxerr.Wrap(ctx, err, "listing available fleet managed apps")
|
||||
}
|
||||
|
||||
return avail, meta, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user