schema

package
v0.0.0-...-1eed7ee Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PermissionCreateUser = 1 << iota
	PermissionModifySelfTasks
	PermissionModifyAllUsers
	PermissionModifyAllUsersRestricted
	PermissionViewAllTasks
	PermissionModifyAllTasks
)

Variables

Functions

func RoleHasPermission

func RoleHasPermission(role, perm int) bool

Types

type User

type User struct {
	ID          bson.ObjectId `bson:"_id,omitempty" json:"id"`
	Username    *string       `bson:"username,omitempty" json:"username,omitempty"`
	OldPassword *string       `bson:"-" json:"oldPassword,omitempty"`
	Password    *string       `bson:"password,omitempty" json:"password,omitempty"`
	Email       *string       `bson:"email,omitempty" json:"email,omitempty"`
	Role        *int          `bson:"role,omitempty" json:"role"`
}

func (*User) Validate

func (u *User) Validate() error

type UserSecure

type UserSecure struct {
	ID       bson.ObjectId `bson:"_id,omitempty" json:"id"`
	Username string        `bson:"username" json:"username"`
	Email    string        `bson:"email" json:"email"`
	Role     int           `bson:"role" json:"role"`
}

Jump to

Keyboard shortcuts

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