Documentation ¶ Index ¶ Variables func AddRule(e Entity, a Action, r Role) func Can(role Role, a Action, e Entity) bool type Action type Entity type Role func (r Role) Equal(r2 Role) bool func (r *Role) Scan(value interface{}) error func (r Role) Value() (driver.Value, error) type Rule Constants ¶ This section is empty. Variables ¶ View Source var Rules []Rule Functions ¶ func AddRule ¶ func AddRule(e Entity, a Action, r Role) func Can ¶ func Can(role Role, a Action, e Entity) bool Types ¶ type Action ¶ type Action int const ( ActionCreate Action = iota ActionDelete ActionEdit ActionView ) type Entity ¶ type Entity string type Role ¶ type Role string func (Role) Equal ¶ func (r Role) Equal(r2 Role) bool func (*Role) Scan ¶ func (r *Role) Scan(value interface{}) error func (Role) Value ¶ func (r Role) Value() (driver.Value, error) type Rule ¶ type Rule struct { Role Role Action Action Entity Entity } Source Files ¶ View all Source files roles.go Click to show internal directories. Click to hide internal directories.