WIP plaintextdocument
This commit is contained in:
parent
02d2b948a3
commit
67dba37ea3
@ -11,7 +11,7 @@ import (
|
|||||||
type MarshalledChange = []byte
|
type MarshalledChange = []byte
|
||||||
|
|
||||||
type ACLChangeBuilder interface {
|
type ACLChangeBuilder interface {
|
||||||
UserAdd(identity string, encryptionKey keys.EncryptionPubKey)
|
UserAdd(identity string, encryptionKey keys.EncryptionPubKey, permissions pb.ACLChangeUserPermissions)
|
||||||
AddId(id string) // TODO: this is only for testing
|
AddId(id string) // TODO: this is only for testing
|
||||||
SetMakeSnapshot(bool) // TODO: who should decide this? probably ACLTree so we can delete it
|
SetMakeSnapshot(bool) // TODO: who should decide this? probably ACLTree so we can delete it
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,9 @@ package plaintextdocument
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/anytypeio/go-anytype-infrastructure-experiments/account"
|
"github.com/anytypeio/go-anytype-infrastructure-experiments/account"
|
||||||
|
aclpb "github.com/anytypeio/go-anytype-infrastructure-experiments/aclchanges/pb"
|
||||||
"github.com/anytypeio/go-anytype-infrastructure-experiments/acltree"
|
"github.com/anytypeio/go-anytype-infrastructure-experiments/acltree"
|
||||||
"github.com/anytypeio/go-anytype-infrastructure-experiments/testutils/testchanges/pb"
|
"github.com/anytypeio/go-anytype-infrastructure-experiments/testutils/testchanges/pb"
|
||||||
"github.com/anytypeio/go-anytype-infrastructure-experiments/thread"
|
"github.com/anytypeio/go-anytype-infrastructure-experiments/thread"
|
||||||
@ -113,7 +115,7 @@ func NewPlainTextDocument(
|
|||||||
create func(change *thread.RawChange) (thread.Thread, error),
|
create func(change *thread.RawChange) (thread.Thread, error),
|
||||||
text string) (PlainTextDocument, error) {
|
text string) (PlainTextDocument, error) {
|
||||||
changeBuilder := func(builder acltree.ChangeBuilder) {
|
changeBuilder := func(builder acltree.ChangeBuilder) {
|
||||||
builder.UserAdd(acc.Identity, acc.EncKey.GetPublic())
|
builder.UserAdd(acc.Identity, acc.EncKey.GetPublic(), aclpb.ACLChange_Admin)
|
||||||
builder.AddChangeContent(createInitialChangeContent(text))
|
builder.AddChangeContent(createInitialChangeContent(text))
|
||||||
}
|
}
|
||||||
t, err := acltree.BuildThreadWithACL(
|
t, err := acltree.BuildThreadWithACL(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user