permission

package
Version: v0.0.0-...-e76cf3b Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Admin   Role = "admin"
	Manager      = "manager"
	Viewer       = "viewer"
)

Variables

This section is empty.

Functions

func ResponseError

func ResponseError(w http.ResponseWriter, statusCode int, err error)

func ResponseSuccess

func ResponseSuccess(w http.ResponseWriter, msg string)

Types

type Data

type Data struct {
	Email string `json:"email"`
	Name  string `json:"name"`
	Roles Roles  `json:"roles"`
	Slug  string `json:"slug"`
}

type General

type General struct {
	Institution string `json:"institutionId"`
	Email       string `json:"email"`
	Role        Role   `json:"role"`
}

type ParticipantPermission

type ParticipantPermission struct {
	UID           string `json:"user_id" bson:"user_id"`
	InstitutionID string `json:"institution_id" bson:"institution_id"`
	Roles         Roles  `json:"roles" bson:"roles"`
}

type Profile

type Profile struct {
	Email string `json:"email" bson:"email"`
}

type Role

type Role string

type Roles

type Roles struct {
	Admin   bool `json:"admin" bson:"admin"`
	Manager bool `json:"manager" bson:"manager"`
	Viewer  bool `json:"viewer" bson:"viewer"`
}

type SuperPermission

type SuperPermission struct {
	Role Roles `json:"roles" bson:"roles"`
}

type User

type User struct {
	UID              primitive.ObjectID `json:"_id" bson:"_id"`
	Profile          Profile            `json:"profile" bson:"profile"`
	SuperPermissions SuperPermission    `json:"super_permission" bson:"super_permission"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL