Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SpecialAuths = map[string]AuthChecker{ `/server/cmdSend/*`: func( h echo.Handler, c echo.Context, rpath string, user *dbschema.User, roleM *model.UserRole, roleList []*dbschema.UserRole, ) (err error, ppath string, returning bool) { returning = true c.SetFunc(`CheckPerm`, func(id string) error { if user.Id == 1 { return nil } if len(id) > 0 { if !roleM.CheckCmdPerm2(roleList, id) { return echo.ErrForbidden } } else { if !roleM.CheckPerm2(roleList, `server/cmd`) { return echo.ErrForbidden } } return nil }) err = h.Handle(c) return }, `server/dynamic`: func( h echo.Handler, c echo.Context, rpath string, user *dbschema.User, roleM *model.UserRole, roleList []*dbschema.UserRole, ) (err error, ppath string, returning bool) { ppath = `server/sysinfo` return }, `/server/cmd`: func( h echo.Handler, c echo.Context, rpath string, user *dbschema.User, roleM *model.UserRole, roleList []*dbschema.UserRole, ) (err error, ppath string, returning bool) { id := c.Form(`id`) if len(id) > 0 { returning = true if !roleM.CheckCmdPerm2(roleList, id) { err = echo.ErrForbidden return } err = h.Handle(c) return } ppath = `cmd` return }, `/manager/crop`: func( h echo.Handler, c echo.Context, rpath string, user *dbschema.User, roleM *model.UserRole, roleList []*dbschema.UserRole, ) (err error, ppath string, returning bool) { ppath = `/manager/upload/:type` return }, }
Functions ¶
func AuthRegister ¶
func AuthRegister(ppath string, checker AuthChecker)
func AuthUnregister ¶
func AuthUnregister(ppath string)
Types ¶
Click to show internal directories.
Click to hide internal directories.