Helper function to select access mode for the given auth level
(authLvl auth.Level, anonMode, authMode, rootMode types.AccessMode)
| 226 | |
| 227 | // Helper function to select access mode for the given auth level |
| 228 | func 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 |
| 244 | func getDefaultAccess(cat types.TopicCat, authUser, isChan bool) types.AccessMode { |
no outgoing calls
no test coverage detected
searching dependent graphs…