Documentation ¶
Index ¶
Constants ¶
View Source
const (
ACL_ENTRY_ID = "ACL_ENTRY"
)
Variables ¶
This section is empty.
Functions ¶
func GetPermissions ¶
TODO: inheritation!
Types ¶
type ACL ¶
type ACL struct { // The permission, eg. "read", "write", "admin" Permission string // Who has the permission, eg. "u:michael", "g:administrators" Principal string }
func BuildPermissionACLs ¶
type ACLEntry ¶
type ACLEntry struct { // Parseable reference to the object ACL entry belongs to, eg. "wiki:example1" ObjReference string // All the defined ACLs for object ACLs []ACL // Should be use inheritation with ACLs? Inheritation bool // Parent for calculating inheritation, eg. "page:level2page" or "" Parent string }
func GetACLEntry ¶
func GetACLEntry(reference string, item Filterable, inheritation bool) ACLEntry
Get ACL entry from cache. If not available, build new (and set in cache) If the type changes in inheritation, the BuildACLEntry before change should know how to build the next types!
type Filterable ¶
type Filterable interface { SetMatched(permissions []string) interface{} BuildACLReference() string BuildACLEntry(reference string) ACLEntry BuildACLInheritation() bool BuildACLParent() string }
func Filter ¶
func Filter(c map[string]interface{}, permissions []string, i interface{}, inheritation bool) []Filterable
Filters items based on user's roles. Returns those that match any of the listed permissions.
func Get_filterable ¶
func Get_filterable(items interface{}) []Filterable
Takes any interface{} and attempts to convert it to []Filterable
Click to show internal directories.
Click to hide internal directories.