Documentation
¶
Index ¶
- func GinCtxWithKeys(keys []string, values ...interface{}) *gin.Context
- func HeaderInvalid() string
- func HeaderValid() string
- func Str2Ptr(s string) *string
- func TestTime(year int) time.Time
- func TestTimePtr(year int) *time.Time
- type Auth
- type JWT
- type RBAC
- func (a *RBAC) AccountCreate(c *gin.Context, roleID, companyID, locationID int) bool
- func (a *RBAC) EnforceCompany(c *gin.Context, id int) bool
- func (a *RBAC) EnforceLocation(c *gin.Context, id int) bool
- func (a *RBAC) EnforceRole(c *gin.Context, role model.AccessRole) bool
- func (a *RBAC) EnforceUser(c *gin.Context, id int) bool
- func (a *RBAC) IsLowerRole(c *gin.Context, role model.AccessRole) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GinCtxWithKeys ¶
GinCtxWithKeys returns new gin context with keys
Types ¶
type Auth ¶
Auth mock
type JWT ¶
JWT mock
type RBAC ¶
type RBAC struct {
EnforceRoleFn func(*gin.Context, model.AccessRole) bool
EnforceUserFn func(*gin.Context, int) bool
EnforceCompanyFn func(*gin.Context, int) bool
EnforceLocationFn func(*gin.Context, int) bool
AccountCreateFn func(*gin.Context, int, int, int) bool
IsLowerRoleFn func(*gin.Context, model.AccessRole) bool
}
RBAC Mock
func (*RBAC) AccountCreate ¶
AccountCreate mock
func (*RBAC) EnforceCompany ¶
EnforceCompany mock
func (*RBAC) EnforceLocation ¶
EnforceLocation mock
func (*RBAC) EnforceRole ¶
EnforceRole mock
Source Files
¶
- auth.go
- mock.go
- mw.go
- rbac.go
Click to show internal directories.
Click to hide internal directories.