MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / validate

Method validate

auth/role.go:357–362  ·  view source on GitHub ↗

Checks whether this role object contains valid data; if not, returns an error.

()

Source from the content-addressed store, hash-verified

355
356// Checks whether this role object contains valid data; if not, returns an error.
357func (role *roleImpl) validate() error {
358 if !IsValidPrincipalName(role.Name_) {
359 return base.HTTPErrorf(http.StatusBadRequest, "Invalid name %q", role.Name_)
360 }
361 return role.ExplicitChannels_.Validate()
362}
363
364//////// CHANNEL AUTHORIZATION:
365

Callers 1

initRoleMethod · 0.95

Calls 3

HTTPErrorfFunction · 0.92
IsValidPrincipalNameFunction · 0.85
ValidateMethod · 0.45

Tested by

no test coverage detected