user

package
v0.0.0-...-d4285bb Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2014 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package user provides data structures and methods for interacting with users in the Impendulo system.

Index

Constants

View Source
const (
	//Permissions
	NONE Permission = iota
	STUDENT
	TEACHER
	ADMIN
	//struct db names
	ID     = "_id"
	PWORD  = "password"
	SALT   = "salt"
	ACCESS = "access"
)

Variables

This section is empty.

Functions

func ValidPermission

func ValidPermission(p int) bool

Types

type Permission

type Permission int

func Permissions

func Permissions() []Permission

func (Permission) Name

func (p Permission) Name() string

type PermissionInfo

type PermissionInfo struct {
	Access Permission
	Name   string
}

func PermissionInfos

func PermissionInfos() []*PermissionInfo

type User

type User struct {
	Name     string     `bson:"_id"`
	Password string     `bson:"password"`
	Salt     string     `bson:"salt"`
	Access   Permission `bson:"access"`
}

User represents a user within the Impendulo system.

func New

func New(u, p string) *User

New creates a new user with file submission permissions.

func Read

func Read(n string) ([]*User, error)

Read reads user configurations from a file. It also sets up their passwords.

func (*User) String

func (u *User) String() string

String

Jump to

Keyboard shortcuts

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