(db *db.Database, princ auth.Principal)
| 1888 | } |
| 1889 | |
| 1890 | func getAuditEventAccess(db *db.Database, princ auth.Principal) map[string]map[string][]string { |
| 1891 | auditEventAccess := make(map[string]map[string][]string) |
| 1892 | if db.OnlyDefaultCollection() { |
| 1893 | collectionAccess := make(map[string][]string) |
| 1894 | collectionAccess[base.DefaultCollection] = princ.ExplicitChannels().AllKeys() |
| 1895 | auditEventAccess[base.DefaultScope] = collectionAccess |
| 1896 | } else { |
| 1897 | auditEventAccess = auth.GetExplicitCollectionChannelsForAuditEvent(princ.GetCollectionsAccess()) |
| 1898 | // we support specifying both collection access and legacy way for default collection, if there are some channels |
| 1899 | // specified for default collection in legacy way, add them here |
| 1900 | defaultChannels := princ.ExplicitChannels().AllKeys() |
| 1901 | if db.HasDefaultCollection() && len(auditEventAccess[base.DefaultScope][base.DefaultCollection]) == 0 { |
| 1902 | auditEventAccess[base.DefaultScope][base.DefaultCollection] = defaultChannels |
| 1903 | } |
| 1904 | } |
| 1905 | return auditEventAccess |
| 1906 | } |
| 1907 | |
| 1908 | // Handles PUT or POST to /_user/* |
| 1909 | func (h *handler) putUser() error { |
no test coverage detected