MCPcopy
hub / github.com/dgraph-io/dgraph / isMutationAllowed

Function isMutationAllowed

edgraph/server.go:2161–2170  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------- HELPER FUNCTIONS -------------------------------------------------------------------------------------------------

(ctx context.Context)

Source from the content-addressed store, hash-verified

2159// HELPER FUNCTIONS
2160// -------------------------------------------------------------------------------------------------
2161func isMutationAllowed(ctx context.Context) bool {
2162 if worker.Config.MutationsMode != worker.DisallowMutations {
2163 return true
2164 }
2165 shareAllowed, ok := ctx.Value("_share_").(bool)
2166 if !ok || !shareAllowed {
2167 return false
2168 }
2169 return true
2170}
2171
2172var errNoAuth = errors.Errorf("No Auth Token found. Token needed for Admin operations.")
2173

Callers 2

validateAlterOperationFunction · 0.85
doMutateMethod · 0.85

Calls 1

ValueMethod · 0.45

Tested by

no test coverage detected