MCPcopy Create free account
hub / github.com/Permify/permify / checkDepth

Function checkDepth

internal/invoke/utils.go:11–16  ·  view source on GitHub ↗

checkDepth validates that the request has sufficient depth for permission checks

(request *base.PermissionCheckRequest)

Source from the content-addressed store, hash-verified

9
10// checkDepth validates that the request has sufficient depth for permission checks
11func checkDepth(request *base.PermissionCheckRequest) error {
12 if atomic.LoadInt32(&request.GetMetadata().Depth) < 0 { // Check depth is not negative
13 return errors.New(base.ErrorCode_ERROR_CODE_DEPTH_NOT_ENOUGH.String())
14 }
15 return nil
16}

Callers 1

CheckMethod · 0.85

Calls 2

StringMethod · 0.65
GetMetadataMethod · 0.45

Tested by

no test coverage detected