Documentation ¶
Index ¶
- Variables
- type Policy
- func (policy *Policy) Has(ctx context.Context, username string, slug string) (grant models.Grant, err error)
- func (policy *Policy) Instance(ctx context.Context, slug string) (grants []models.Grant, err error)
- func (pol *Policy) OnUserDelete(ctx context.Context, user *models.User) error
- func (*Policy) Provision(ctx context.Context, instance models.Instance, domain string) error
- func (pol *Policy) Purge(ctx context.Context, instance models.Instance, domain string) error
- func (policy *Policy) Remove(ctx context.Context, username string, slug string) error
- func (policy *Policy) Set(ctx context.Context, grant models.Grant) error
- func (pol *Policy) TableInfo() component.TableInfo
- func (policy *Policy) User(ctx context.Context, username string) (grants []models.Grant, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoAccess = errors.New("no access") ErrInvalid = errors.New("invalid parameters") )
Functions ¶
This section is empty.
Types ¶
type Policy ¶
func (*Policy) Has ¶
func (policy *Policy) Has(ctx context.Context, username string, slug string) (grant models.Grant, err error)
Has checks if the given username has access to the given instance. If the user has access, returns the provided grant.
If the user does not have access, returns ErrNoAccess. Other errors may be returned in other cases.
func (*Policy) OnUserDelete ¶
OnUserDelete is called when a user is deleted
func (*Policy) Remove ¶
Remove removes access for the given username form the given instance. The user not having access is not an error.
Click to show internal directories.
Click to hide internal directories.