func (s *stateEP) DelOrgs(delorgs ...string) {
	for _, delorg := range delorgs {
		delete(s.orgs, delorg)
	}
}
DelOrgs delete the specified channel orgs from the existing key-level EP
package statebased
import (
	"fmt"
	"sort"
	"github.com/golang/protobuf/proto"
	"github.com/hyperledger/fabric-protos-go/common"
	"github.com/hyperledger/fabric-protos-go/msp"
)
type stateEP struct {
	orgs map[string]msp.MSPRole_MSPRoleType
}
func NewStateEP(policy []byte) (KeyEndorsementPolicy, error) {
	s := &stateEP{orgs: make(map[string]msp.MSPRole_MSPRoleType)}
	if policy != nil {
		spe := &common.SignaturePolicyEnvelope{}
		if err := proto.Unmarshal(policy, spe); err != nil {
			return nil, fmt.Errorf("Error unmarshaling to SignaturePolicy: %s", err)
		}
		err := s.setMSPIDsFromSP(spe)
		if err != nil {
			return nil, err
		}
	}
	return s, nil
}
func (s *stateEP) Policy() ([]byte, error) {
	spe, err := s.policyFromMSPIDs()
	if err != nil {
		return nil, err
	}
	spBytes, err := proto.Marshal(spe)
	if err != nil {
		return nil, err
	}
	return spBytes, nil
}
func (s *stateEP) AddOrgs(role RoleType, neworgs ...string) error {
	var mspRole msp.MSPRole_MSPRoleType
	switch role {
	case RoleTypeMember:
		mspRole = msp.MSPRole_MEMBER
	case RoleTypePeer:
		mspRole = msp.MSPRole_PEER
	default:
		return &RoleTypeDoesNotExistError{RoleType: role}
	}
	for _, addorg := range neworgs {
		s.orgs[addorg] = mspRole
	}
	return nil
}