func (p *PolicyTemplate) AddPermission(constructor, action, target string) {
	p.PermissionTemplates = append(p.PermissionTemplates, PermissionTemplate{constructor, action, target})
}
AddPermission adds a new PermissionTemplate to p.PermissionTemplates.
package rbac
import (
	"encoding/json"
	"fmt"
	"strings"
)
type PermissionConstructor func(action, target string) Permission
func DefaultPermissionConstructors() map[string]PermissionConstructor {
	return map[string]PermissionConstructor{
		"glob":   NewGlobPermission,
		"regex":  NewRegexPermission,
		"string": NewStringPermission,
	}
}
type PermissionTemplate struct {
	Constructor string `json:"constructor"`
	Action      string `json:"action"`
	Target      string `json:"target"`
}
type PolicyTemplate struct {
	RoleID              string               `json:"role_id"`
	PermissionTemplates []PermissionTemplate `json:"permissions"`
	constructors        map[string]PermissionConstructor
}
func NewPolicyTemplate(roleID string) *PolicyTemplate {
	return &PolicyTemplate{
		RoleID:              roleID,
		PermissionTemplates: []PermissionTemplate{},
		constructors:        DefaultPermissionConstructors(),
	}
}