models

package
v0.0.0-...-eca3c71 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2014 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	backends.Group
}

type GroupCollection

type GroupCollection struct {
}

func Groups

func Groups() *GroupCollection

func (*GroupCollection) All

func (this *GroupCollection) All() (groups []Group, err *backend.Error)

func (*GroupCollection) AllByUser

func (this *GroupCollection) AllByUser(name_or_uid string) (groups []Group, err *backend.Error)

func (*GroupCollection) AllByUserWithoutPermissions

func (this *GroupCollection) AllByUserWithoutPermissions(name_or_uid string) (groups []Group, err *backend.Error)

func (*GroupCollection) AllPermissions

func (this *GroupCollection) AllPermissions() (groups []Group, err *backend.Error)

func (*GroupCollection) AllWithoutPermissions

func (this *GroupCollection) AllWithoutPermissions() (groups []Group, err *backend.Error)

func (*GroupCollection) Create

func (this *GroupCollection) Create(name string) (created bool, id int64, err *backend.Error)

func (*GroupCollection) Destroy

func (this *GroupCollection) Destroy(name_or_uid string) (deleted bool, err *backend.Error)

type Permission

type Permission struct {
	Internal bool   // when it belongs to user stack web
	Name     string // e.g. list_users
}

func (*Permission) GroupName

func (this *Permission) GroupName() string

type PermissionCollection

type PermissionCollection struct {
}

func Permissions

func Permissions() *PermissionCollection

func (*PermissionCollection) All

func (this *PermissionCollection) All() (permissions []*Permission)

func (*PermissionCollection) AllInternal

func (this *PermissionCollection) AllInternal() (permissions []*Permission)

func (*PermissionCollection) AllNames

func (this *PermissionCollection) AllNames() []string

func (*PermissionCollection) BuildName

func (this *PermissionCollection) BuildName(object string, verb string) string

e.g. users, list => users_list

func (*PermissionCollection) Create

func (this *PermissionCollection) Create(object string, verb string)

func (*PermissionCollection) CreateAllInternal

func (this *PermissionCollection) CreateAllInternal()

func (*PermissionCollection) Destroy

func (this *PermissionCollection) Destroy(name string)

func (*PermissionCollection) GroupName

func (this *PermissionCollection) GroupName(name string) (groupName string)

e.g. list_users => perm.users.list

func (*PermissionCollection) IsPermissionGroupName

func (this *PermissionCollection) IsPermissionGroupName(groupName string) (isPermissionGroupName bool)

func (*PermissionCollection) Name

func (this *PermissionCollection) Name(groupName string) (name string)

e.g. list_users

type StatsCollection

type StatsCollection struct {
}

func Stats

func Stats() *StatsCollection

func (*StatsCollection) All

func (this *StatsCollection) All() (stats map[string]int64, err *backend.Error)

type User

type User struct {
	backends.User
}

func (*User) AllData

func (this *User) AllData() (allData map[string]interface{}, err *backend.Error)

func (*User) Data

func (this *User) Data(key string) (data string, err *backend.Error)

func (*User) DataAsTime

func (this *User) DataAsTime(key string) (data time.Time, err *backend.Error)

func (*User) DataKeys

func (this *User) DataKeys() (keys []string, err *backend.Error)

type UserCollection

type UserCollection struct {
}

func Users

func Users() *UserCollection

func (*UserCollection) AddUserToGroup

func (this *UserCollection) AddUserToGroup(name_or_uid string, group_id string) (updated bool, err *backend.Error)

func (*UserCollection) All

func (this *UserCollection) All() (users []User, err *backend.Error)

func (*UserCollection) AllByGroup

func (this *UserCollection) AllByGroup(groupId string) (users []User, err *backend.Error)

func (*UserCollection) Create

func (this *UserCollection) Create(username string, password string) (created bool, id int64, err *backend.Error)

func (*UserCollection) Destroy

func (this *UserCollection) Destroy(name_or_uid string) (deleted bool, err *backend.Error)

func (*UserCollection) Disable

func (this *UserCollection) Disable(name_or_uid string) (deleted bool, err *backend.Error)

func (*UserCollection) Enable

func (this *UserCollection) Enable(name_or_uid string) (deleted bool, err *backend.Error)

func (*UserCollection) Find

func (this *UserCollection) Find(uid int64) (user *User, err *backend.Error)

func (*UserCollection) FindByName

func (this *UserCollection) FindByName(username string) (user *User, err *backend.Error)

func (*UserCollection) Login

func (this *UserCollection) Login(username string, password string) (loggedIn bool, id int64, err *backend.Error)

func (*UserCollection) RemoveUserFromGroup

func (this *UserCollection) RemoveUserFromGroup(name_or_uid string, group_id string) (updated bool, err *backend.Error)

func (*UserCollection) UpdatePassword

func (this *UserCollection) UpdatePassword(name_or_uid string, password string, newPassword string) (updated bool, err *backend.Error)

func (*UserCollection) UpdateUsername

func (this *UserCollection) UpdateUsername(name_or_uid string, password string, newUsername string) (updated bool, err *backend.Error)

type UserPermission

type UserPermission struct {
	Permission *Permission
	Granted    bool
}

type UserPermissionCollection

type UserPermissionCollection struct {
}

func UserPermissions

func UserPermissions() *UserPermissionCollection

func (*UserPermissionCollection) Abilities

func (this *UserPermissionCollection) Abilities(name_or_uid string) (abilities map[string]bool)

func (*UserPermissionCollection) All

func (this *UserPermissionCollection) All(name_or_uid string) (userPermissions []*UserPermission)

func (*UserPermissionCollection) Allow

func (this *UserPermissionCollection) Allow(name_or_uid string, permissionName string)

func (*UserPermissionCollection) AllowAll

func (this *UserPermissionCollection) AllowAll(name_or_uid string)

func (*UserPermissionCollection) Deny

func (this *UserPermissionCollection) Deny(name_or_uid string, permissionName string)

func (*UserPermissionCollection) NoAbilities

func (this *UserPermissionCollection) NoAbilities() (allGroupNamesMap map[string]bool)

Jump to

Keyboard shortcuts

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