Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer struct {
// contains filtered or unexported fields
}
func New ¶
func New(model, policy string) *Authorizer
model and policy arguments are paths to the files where we defined the model (which will configure Casbin's authorization mechanism - which in this case will be ACL) and the policy (which is a CSV file containing our ACL table).
func (*Authorizer) Authorize ¶
func (a *Authorizer) Authorize(sub, obj, action string) error
Returns whether the given subject is permitted to run the given action on the given object based on the model and policy used in Casbin's configuration.
Click to show internal directories.
Click to hide internal directories.