func (a Acl) GetAllPermissions() PermissionsMap {
	lock.Lock()
	defer lock.Unlock()
	permissions := make(PermissionsMap)
	for _, e := range a.Permissions {
		for p := range e.Permissions {
			permissions[p] = ""
		}
	}
	logger.Trace.Println("The permissions of acl are:", permissions)
	return permissions
}
GetAllPermissions : Return all the permissions that are associated with the entity
package acl
import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"os"
	"reflect"
	"strings"
	"sync"
	defs "github.com/ibm-security-innovation/libsecurity-go/defs"
	en "github.com/ibm-security-innovation/libsecurity-go/entity"
	logger "github.com/ibm-security-innovation/libsecurity-go/logger"
	ss "github.com/ibm-security-innovation/libsecurity-go/storage"
)
const ()
var (
	lock sync.Mutex
)
type aclEntryMap map[string]*Entry
type PermissionSet map[string]interface{}
type Serializer struct{}
type Acl struct {
	Permissions aclEntryMap
}
func (a Acl) String() string {
	return fmt.Sprintf("ACL: Permission entries: %v\n", getAclEntryListItem(a.Permissions))
}
func init() {
	logger.Init(ioutil.Discard, ioutil.Discard, os.Stdout, os.Stderr)
	defs.Serializers[defs.AclPropertyName] = &Serializer{}
	en.RemoveEntityFromAcl = RemoveEntityFromAcl
}
func NewACL() *Acl {
	a := Acl{Permissions: make(aclEntryMap)}
	return &a
}
func (a *Acl) IsEqual(acl Acl) bool {
	return (reflect.DeepEqual(a.Permissions, acl.Permissions) == true)
}
func isValidAclEntry(aclEntry *Entry) error {
	if aclEntry == nil {
		return fmt.Errorf("aclEntry is nil")
	}
	return en.IsEntityNameValid(aclEntry.EntityName)
}
func getAclEntryListItem(eList aclEntryMap) string {
	uArray := make([]string, 0, len(eList))
	for _, p := range eList {
		uArray = append(uArray, fmt.Sprintf("\n\t%v", p))
	}
	return strings.Join(uArray, ",")
}
func (a *Acl) addAclEntry(aclEntry *Entry) error {
	lock.Lock()
	defer lock.Unlock()
	err := isValidAclEntry(aclEntry)
	if err != nil {
		return err
	}
	_, exist := a.Permissions[aclEntry.EntityName]
	if exist == true {
		return fmt.Errorf("Cannot add aclEntry '%v', it already exists in the ACL", aclEntry.EntityName)
	}
	a.Permissions[aclEntry.EntityName] = aclEntry
	logger.Trace.Println("Add aclEntry:", aclEntry, "to acl")
	return nil
}
func (a *Acl) removeAclEntry(name string) error {
	lock.Lock()
	defer lock.Unlock()
	err := en.IsEntityNameValid(name)
	if err != nil {
		return err
	}
	_, exist := a.Permissions[name]
	if exist == false {
		return fmt.Errorf("Cannot remove ACL entry '%v', it does not exist in the ACL", name)
	}
	logger.Trace.Println("Remove Entry:", name, "from acl")
	delete(a.Permissions, name)
	return nil
}
func RemoveEntityFromAcl(el1 interface{}, userName string) {
	if el1 == nil {
		return
	}
	el, ok := el1.(*en.EntityManager)
	if ok == false {
		return
	}
	err := en.IsEntityNameValid(userName)
	if err != nil {
		return
	}
	for resourceName := range el.Resources {
		data, err := el.GetPropertyAttachedToEntity(resourceName, defs.AclPropertyName)
		if err != nil {
			continue
		}
		acl, ok := data.(*Acl)
		if ok == false {
			return
		}
		for name := range acl.Permissions {
			if name == userName {
				acl.removeAclEntry(userName)
			}
		}
	}
	return
}