func (m *Manager) SetEntityCapability2(ID string, c *pb.Capability) error {
	if c == nil {
		return ErrUnknownCapability
	}
	de := &pb.Entity{
		ID: &ID,
		Meta: &pb.EntityMeta{
			Capabilities: []pb.Capability{*c},
		},
	}
	_, err := m.RunEntityChain("SET-CAPABILITY", de)
	return err
}
SetEntityCapability2 adds a capability to an entity directly, and
does so with a strongly typed capability pointer.
package tree
import (
	"fmt"
	"strings"
	"github.com/netauth/netauth/internal/tree/util"
	"google.golang.org/protobuf/proto"
	"github.com/netauth/netauth/internal/db"
	pb "github.com/netauth/protocol"
)
func (m *Manager) CreateEntity(ID string, number int32, secret string) error {
	de := &pb.Entity{
		ID:     &ID,
		Number: &number,
		Secret: &secret,
	}
	_, err := m.RunEntityChain("CREATE", de)
	return err
}
func (m *Manager) DestroyEntity(ID string) error {
	de := &pb.Entity{
		ID: &ID,
	}
	_, err := m.RunEntityChain("DESTROY", de)
	return err
}
func (m *Manager) SetEntityCapability(ID string, c string) error {
	capIndex, ok := pb.Capability_value[c]
	if !ok {
		return ErrUnknownCapability
	}
	cap := pb.Capability(capIndex)
	return m.SetEntityCapability2(ID, &cap)
}