Documentation ¶
Index ¶
Constants ¶
View Source
const ( // roles defined here RoleSuperAdmin = "superadmin" RoleAdmin = "admin" RoleUser = "user" // objects defined here ObjectAny = "*" ObjectUser = "user" ObjectSession = "session" ObjectMemo = "memo" )
consts for RBAC
View Source
const ( ActionAny = "*" ActionReadAll = "read_all" ActionRead = "read" ActionCreateAll = "create_all" ActionCreate = "create" ActionUpdateAll = "update_all" ActionUpdate = "update" ActionDeleteAll = "delete_all" ActionDelete = "delete" )
RBAC actions
Variables ¶
View Source
var ( ErrForbiddenAccess = server.NewHTTPError(http.StatusForbidden, "FORBIDDEN", "You don't have permission to access the requested resource") ErrForbiddenAction = server.NewHTTPError(http.StatusForbidden, "FORBIDDEN", "You don't have permission to perform this action") )
Custom errors
View Source
var ValidRoles = []string{RoleSuperAdmin, RoleAdmin, RoleUser}
ValidRoles for validation
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.