permissions

package
v0.0.0-...-16f06e1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2017 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGroups

func GetGroups(jid string) (bool, []string)

func GrantPermission

func GrantPermission(jid string, permission string)

func HasPermission

func HasPermission(jid string, permission string) bool

HasPermission returns true if a jid has the provided permission.

func IsGroupMember

func IsGroupMember(jid string, group string) bool

IsGroupMember returns true is a user is in the provided group. Will also return false if the group does not exist.

func Load

func Load(path string) bool

func RevokePermission

func RevokePermission(jid string, permission string)

func Save

func Save(path string) bool

Types

type GroupsTable

type GroupsTable struct {
	Groups []PermGroup
}

type PermGroup

type PermGroup struct {
	Name        string
	Permissions []string
}

type PermsTable

type PermsTable struct {
	Users []User
}

type User

type User struct {
	JID         string
	Groups      []string
	Permissions []string
}

Jump to

Keyboard shortcuts

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