Documentation
¶
Index ¶
- Variables
- func NewManager(client *ent.Client) ladon.Manager
- type EntManager
- func (l *EntManager) Create(policy ladon.Policy) error
- func (l *EntManager) Delete(id string) error
- func (l *EntManager) FindPoliciesForResource(resource string) (ladon.Policies, error)
- func (l *EntManager) FindPoliciesForSubject(subject string) (ladon.Policies, error)
- func (l *EntManager) FindRequestCandidates(r *ladon.Request) (ladon.Policies, error)
- func (l *EntManager) Get(id string) (ladon.Policy, error)
- func (l *EntManager) GetAll(limit int64, offset int64) (ladon.Policies, error)
- func (l *EntManager) Update(policy ladon.Policy) error
Constants ¶
This section is empty.
Variables ¶
var ProviderSet = wire.NewSet(NewManager)
Functions ¶
Types ¶
type EntManager ¶
type EntManager struct {
// contains filtered or unexported fields
}
func (*EntManager) Create ¶
func (l *EntManager) Create(policy ladon.Policy) error
Create persists the policy.
func (*EntManager) FindPoliciesForResource ¶
func (l *EntManager) FindPoliciesForResource(resource string) (ladon.Policies, error)
FindPoliciesForResource returns policies that could match the resource. It either returns a set of policies that apply to the resource, or a superset of it. If an error occurs, it returns nil and the error.
func (*EntManager) FindPoliciesForSubject ¶
func (l *EntManager) FindPoliciesForSubject(subject string) (ladon.Policies, error)
FindPoliciesForSubject returns policies that could match the subject. It either returns a set of policies that applies to the subject, or a superset of it. If an error occurs, it returns nil and the error.
func (*EntManager) FindRequestCandidates ¶
FindRequestCandidates returns candidates that could match the request object. It either returns a set that exactly matches the request, or a superset of it. If an error occurs, it returns nil and the error.
func (*EntManager) Get ¶
func (l *EntManager) Get(id string) (ladon.Policy, error)
Get retrieves a policy.