IsRegisteredReservedPredicate reports whether pred is owned by a registered ReservedNamespace (by dynamic prefix or exact name). The alter validator and the no-schema mutation guard allow such predicates through even though they are not pre-defined. With no registration it always reports false.
(pred string)
| 752 | // the no-schema mutation guard allow such predicates through even though they |
| 753 | // are not pre-defined. With no registration it always reports false. |
| 754 | func IsRegisteredReservedPredicate(pred string) bool { |
| 755 | p := strings.ToLower(ParseAttr(pred)) |
| 756 | reservedNsMu.RLock() |
| 757 | defer reservedNsMu.RUnlock() |
| 758 | for _, prefix := range reservedNsPrefixes { |
| 759 | if strings.HasPrefix(p, prefix) { |
| 760 | return true |
| 761 | } |
| 762 | } |
| 763 | _, ok := reservedNsPredicates[p] |
| 764 | return ok |
| 765 | } |
| 766 | |
| 767 | // IsRegisteredReservedType reports whether typ is a type owned by a registered |
| 768 | // ReservedNamespace. With no registration it always reports false. |
searching dependent graphs…