func nodeOperations(n *gen.Type) ([]string, error) {
	c, err := config(n.Config)
	if err != nil {
		return nil, err
	}
	ops := []string{opCreate, opRead, opUpdate, opDelete, opList}
	ant := &SchemaAnnotation{}
	// If no policies are given follow the global policy.
	if n.Annotations == nil || n.Annotations[ant.Name()] == nil {
		if c.HandlerPolicy == Expose {
			return ops, nil
		}
		return nil, nil
	} else {
		if err := ant.Decode(n.Annotations[ant.Name()]); err != nil {
			return nil, err
		}
		var ops []string
		if ant.CreatePolicy == Expose || (ant.CreatePolicy == None && c.HandlerPolicy == Expose) {
			ops = append(ops, opCreate)
		}
		if ant.ReadPolicy == Expose || (ant.ReadPolicy == None && c.HandlerPolicy == Expose) {
			ops = append(ops, opRead)
		}
		if ant.UpdatePolicy == Expose || (ant.UpdatePolicy == None && c.HandlerPolicy == Expose) {
			ops = append(ops, opUpdate)
		}
		if ant.DeletePolicy == Expose || (ant.DeletePolicy == None && c.HandlerPolicy == Expose) {
			ops = append(ops, opDelete)
		}
		if ant.ListPolicy == Expose || (ant.ListPolicy == None && c.HandlerPolicy == Expose) {
			ops = append(ops, opList)
		}
		return ops, nil
	}
}
// nodeOperations returns the list of operations to expose for this node.
nodeOperations returns the list of operations to expose for this node.
// nodeOperations returns the list of operations to expose for this node .
func nodeOperations(n *gen.Type) ([]string, error) {
	c, err := config(n.Config)
	if err != nil {
		return nil, err
	}
	ops := []string{opCreate, opRead, opUpdate, opDelete, opList}
	ant := &SchemaAnnotation{}
	if n.Annotations == nil || n.Annotations[ant.Name()] == nil {
		if c.HandlerPolicy == Expose {
			return ops, nil
		}
		return nil, nil
	} else {
		if err := ant.Decode(n.Annotations[ant.Name()]); err != nil {
			return nil, err
		}
		var ops []string
		if ant.CreatePolicy == Expose || (ant.CreatePolicy == None && c.HandlerPolicy == Expose) {
			ops = append(ops, opCreate)
		}
		if ant.ReadPolicy == Expose || (ant.ReadPolicy == None && c.HandlerPolicy == Expose) {
			ops = append(ops, opRead)
		}
		if ant.UpdatePolicy == Expose || (ant.UpdatePolicy == None && c.HandlerPolicy == Expose) {
			ops = append(ops, opUpdate)
		}
		if ant.DeletePolicy == Expose || (ant.DeletePolicy == None && c.HandlerPolicy == Expose) {
			ops = append(ops, opDelete)
		}
		if ant.ListPolicy == Expose || (ant.ListPolicy == None && c.HandlerPolicy == Expose) {
			ops = append(ops, opList)
		}
		return ops, nil
	}
}
func nodeOperations ( n * gen . Type ) ( [ ] string , error ) { c , err := config ( n . Config ) if err != nil { return nil , err } ops := [ ] string { opCreate , opRead , opUpdate , opDelete , opList } ant := & SchemaAnnotation { } if n . Annotations == nil || n . Annotations [ ant . Name ( ) ] == nil { if c . HandlerPolicy == Expose { return ops , nil } return nil , nil } else { if err := ant . Decode ( n . Annotations [ ant . Name ( ) ] ) ; err != nil { return nil , err } var ops [ ] string if ant . CreatePolicy == Expose || ( ant . CreatePolicy == None && c . HandlerPolicy == Expose ) { ops = append ( ops , opCreate ) } if ant . ReadPolicy == Expose || ( ant . ReadPolicy == None && c . HandlerPolicy == Expose ) { ops = append ( ops , opRead ) } if ant . UpdatePolicy == Expose || ( ant . UpdatePolicy == None && c . HandlerPolicy == Expose ) { ops = append ( ops , opUpdate ) } if ant . DeletePolicy == Expose || ( ant . DeletePolicy == None && c . HandlerPolicy == Expose ) { ops = append ( ops , opDelete ) } if ant . ListPolicy == Expose || ( ant . ListPolicy == None && c . HandlerPolicy == Expose ) { ops = append ( ops , opList ) } return ops , nil } }
nodeOperations returns the list of operations to expose for this node.
nodeOperations returns the list of operations to expose for this node .
// If no policies are given follow the global policy.