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

Function extractAssertions

pkg/development/coverage/coverage.go:153–162  ·  view source on GitHub ↗

extractAssertions extracts all permission/assertion references from an entity

(entity *base.EntityDefinition)

Source from the content-addressed store, hash-verified

151
152// extractAssertions extracts all permission/assertion references from an entity
153func extractAssertions(entity *base.EntityDefinition) []string {
154 assertions := []string{}
155
156 for _, permission := range entity.GetPermissions() {
157 formatted := formatAssertion(entity.GetName(), permission.GetName())
158 assertions = append(assertions, formatted)
159 }
160
161 return assertions
162}
163
164// calculateEntityCoverages calculates coverage for all entities
165func calculateEntityCoverages(refs []SchemaCoverage, shape file.Shape) []EntityCoverageInfo {

Callers 1

extractEntityReferencesFunction · 0.85

Calls 3

formatAssertionFunction · 0.85
GetPermissionsMethod · 0.80
GetNameMethod · 0.65

Tested by

no test coverage detected