| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| package nosql |
| |
| import ( |
| "v.io/v23/security/access" |
| "v.io/syncbase/v23/services/syncbase/nosql" |
| ) |
| |
| // databaseData represents the persistent state of a Database. |
| type databaseData struct { |
| Name string |
| Version uint64 // covers the Perms field below |
| Perms access.Permissions |
| SchemaMetadata ?nosql.SchemaMetadata |
| } |
| |
| // tableData represents the persistent state of a Table. |
| // TODO(sadovsky): Decide whether to track "empty-prefix" perms here. |
| type tableData struct { |
| Name string |
| Perms access.Permissions |
| } |
| |
| // stPrefixPerms describes internal representation of prefix permissions |
| // in the store. |
| // |
| // Each pair of (key, perms) is stored as two key-value pairs: |
| // "$perms:%table:key" - stPrefixPerms{parent, perms} |
| // "$perms:%table:key~" - stPrefixPerms{parent, perms} |
| // where "~" represents a reserved char that's lexicographically greater than |
| // all chars allowed by clients, %table is the name of the table and parent is |
| // the longest proper prefix of the key that has associated permissions object. |
| type stPrefixPerms struct { |
| Parent string |
| Perms access.Permissions |
| } |