wisski-cloud-distillery/internal/wisski/ingredient/php/users/policy.go
2023-01-06 18:59:09 +01:00

24 lines
509 B
Go

package users
import (
"github.com/FAU-CDI/wisski-distillery/internal/status"
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
)
type UserPolicy struct {
ingredient.Base
}
var (
_ ingredient.WissKIFetcher = (*UserPolicy)(nil)
)
func (up *UserPolicy) Fetch(flags ingredient.FetcherFlags, target *status.WissKI) (err error) {
if flags.Quick {
return nil
}
// read the grants into the info struct
target.Grants, err = up.Malt.Policy.Instance(flags.Context, up.Slug)
return err
}