entities

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeAccess = "EventTypeAccess"
	EventTypeAction = "EventTypeAction"
)

Variables

This section is empty.

Functions

func InitRoleValidator

func InitRoleValidator(r *http.Request, roleRequest *Role) *govalidator.Validator

func InitUserValidator

func InitUserValidator(r *http.Request, userRequest User) *govalidator.Validator

func InitValidator

func InitValidator()

Types

type Action

type Action struct {
	Title   string `json:"title"`
	Allowed bool   `json:"allowed"`
}

type ActionList

type ActionList struct {
	RoleID    string
	Module    string
	SubModule string
	Actions   []string `json:"actions"`
}

type ActionModule

type ActionModule struct {
	Name       string            `json:"module"`
	SubModules []ActionSubModule `json:"submodules"`
}

type ActionSubModule

type ActionSubModule struct {
	Name       string            `json:"submodule"`
	ActionList map[string]string `json:"actionList,omitempty"`
	Actions    map[string]Action `json:"actions"`
}

type LoggedUser

type LoggedUser struct {
	User  *User
	Token *Token
}

LoggedUser logged user struct

type Module

type Module struct {
	Name       string      `json:"module"`
	Access     bool        `json:"access"`
	SubModules []SubModule `json:"submodules"`
}

type ModuleInit

type ModuleInit struct {
	Name       string          `json:"module"`
	SubModules []SubModuleInit `json:"submodules"`
}

type ModuleList

type ModuleList struct {
	RoleID  string
	Modules []string `json:"modules"`
}

type Role

type Role struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name"`
}

type RoleEvent

type RoleEvent struct {
	RoleID    string
	UserID    string
	EventType string
}

type SectionList

type SectionList struct {
	RoleID    string
	Module    string
	SubModule string
	Sections  []string `json:"sections"`
}

type SubModule

type SubModule struct {
	Name     string            `json:"submodule"`
	Access   bool              `json:"access"`
	Actions  map[string]Action `json:"actions,omitempty"`
	Sections map[string]bool   `json:"sections,omitempty"`
}

type SubModuleInit

type SubModuleInit struct {
	Name        string            `json:"submodule"`
	SectionList []string          `json:"sectionList,omitempty"`
	ActionList  map[string]string `json:"actionList,omitempty"`
	Actions     map[string]Action `json:"actions"`
	Sections    map[string]bool   `json:"sections"`
}

type SubModuleList

type SubModuleList struct {
	RoleID     string
	Module     string
	SubModules []string `json:"submodules"`
}

type Token

type Token struct {
	Access  string `json:"access_token"`
	Refresh string `json:"refresh_token"`
}

Token struct

type User

type User struct {
	ID      string   `json:"id"`
	Email   string   `json:"email"`
	Name    string   `json:"name"`
	IsAdmin bool     `json:"is_admin"`
	Roles   []string `json:"roles"`
}

User struct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL