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

Method getRoles

rest/admin_api.go:2083–2097  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2081}
2082
2083func (h *handler) getRoles() error {
2084 includeDeleted, _ := h.getOptBoolQuery(paramDeleted, false)
2085
2086 roles, err := h.db.GetRoleIDs(h.ctx(), h.db.Options.UseViews, includeDeleted)
2087
2088 if err != nil {
2089 return err
2090 }
2091
2092 bytes, err := base.JSONMarshal(roles)
2093
2094 base.Audit(h.ctx(), base.AuditIDRolesAll, base.AuditFields{base.AuditFieldIncludeDeleted: includeDeleted})
2095 h.writeRawJSON(bytes)
2096 return err
2097}
2098
2099func (h *handler) handlePurge() error {
2100 h.assertAdminOnly()

Callers

nothing calls this directly

Calls 6

getOptBoolQueryMethod · 0.95
ctxMethod · 0.95
writeRawJSONMethod · 0.95
JSONMarshalFunction · 0.92
AuditFunction · 0.92
GetRoleIDsMethod · 0.80

Tested by

no test coverage detected