mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 01:15:22 +00:00
d5e40f329e
* Add activities generation * Add activities endpoint * Fix merge error * Fix indentation issue * Add changes file * Address PR review comments * Add mock activity func * Address codacy warings * Set foreign key but on delete set null * Make user_id set to null if deleted
15 lines
412 B
Go
15 lines
412 B
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
"github.com/fleetdm/fleet/v4/server/fleet"
|
|
)
|
|
|
|
// ListActivities returns a slice of activities for the whole organization
|
|
func (svc *Service) ListActivities(ctx context.Context, opt fleet.ListOptions) ([]*fleet.Activity, error) {
|
|
if err := svc.authz.Authorize(ctx, &fleet.Activity{}, fleet.ActionRead); err != nil {
|
|
return nil, err
|
|
}
|
|
return svc.ds.ListActivities(opt)
|
|
}
|