func MockAnon() *User {
	return &User{Role: Anon, Email: "anon@example.com"}
}
MockAnon returns a mock user for testing with Role Anon.
package users
import (
	"github.com/fragmenta/query"
	"github.com/fragmenta/view/helpers"
	"github.com/fragmenta/fragmenta-app/src/lib/resource"
)
const (
	Anon   = 0
	Editor = 10
	Reader = 20
	Admin  = 100
)
func (u *User) RoleOptions() []helpers.Option {
	var options []helpers.Option
	options = append(options, helpers.Option{Id: Reader, Name: "Reader"})
	options = append(options, helpers.Option{Id: Editor, Name: "Editor"})
	options = append(options, helpers.Option{Id: Admin, Name: "Administrator"})
	return options
}
func (u *User) RoleDisplay() string {
	for _, o := range u.RoleOptions() {
		if o.Id == u.Role {
			return o.Name
		}
	}
	return ""
}
func (u *User) Anon() bool {
	return u.Role == Anon || u.ID == 0
}
func (u *User) Admin() bool {
	return u.Role == Admin
}
func (u *User) Reader() bool {
	return u.Role == Reader
}
func Admins() *query.Query {
	return Query().Where("role=?", Admin).Order("name asc")
}
func Editors() *query.Query {
	return Query().Where("role=?", Editor).Order("name asc")
}
func Readers() *query.Query {
	return Query().Where("role=?", Reader).Order("name asc")
}
func (u *User) RoleID() int64 {
	return u.Role
}
func (u *User) UserID() int64 {
	return u.ID
}