func NewELMUnlock(c tree.RefContext) (tree.EntityHook, error) {
	return &EntityLockManager{tree.NewBaseHook("unlock-entity", 40), false}, nil
}
NewELMUnlock returns a configured hook in UNLOCK mode.
package hooks
import (
	"google.golang.org/protobuf/proto"
	"github.com/netauth/netauth/internal/startup"
	"github.com/netauth/netauth/internal/tree"
	pb "github.com/netauth/protocol"
)
type EntityLockManager struct {
	tree.BaseHook
	lockstate bool
}
func (elm *EntityLockManager) Run(e, de *pb.Entity) error {
	e.Meta.Locked = proto.Bool(elm.lockstate)
	return nil
}
func init() {
	startup.RegisterCallback(entityLockCB)
}
func entityLockCB() {
	tree.RegisterEntityHookConstructor("lock-entity", NewELMLock)
	tree.RegisterEntityHookConstructor("unlock-entity", NewELMUnlock)
}
func NewELMLock(c tree.RefContext) (tree.EntityHook, error) {
	return &EntityLockManager{tree.NewBaseHook("lock-entity", 40), true}, nil
}