MCPcopy
hub / github.com/tinode/chat / selectAccessMode

Function selectAccessMode

server/utils.go:228–241  ·  view source on GitHub ↗

Helper function to select access mode for the given auth level

(authLvl auth.Level, anonMode, authMode, rootMode types.AccessMode)

Source from the content-addressed store, hash-verified

226
227// Helper function to select access mode for the given auth level
228func selectAccessMode(authLvl auth.Level, anonMode, authMode, rootMode types.AccessMode) types.AccessMode {
229 switch authLvl {
230 case auth.LevelNone:
231 return types.ModeNone
232 case auth.LevelAnon:
233 return anonMode
234 case auth.LevelAuth:
235 return authMode
236 case auth.LevelRoot:
237 return rootMode
238 default:
239 return types.ModeNone
240 }
241}
242
243// Get default modeWant for the given topic category
244func getDefaultAccess(cat types.TopicCat, authUser, isChan bool) types.AccessMode {

Callers 2

initTopicP2PFunction · 0.85
accessForMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…