1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Update aclstate

This commit is contained in:
Mikhail Rakhmanov 2025-05-09 11:57:33 +02:00
parent bc9193b33a
commit 3ab01e7d96
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
4 changed files with 255 additions and 89 deletions

View file

@ -204,8 +204,9 @@ func (m *AclRoot) GetEncryptedOwnerMetadata() []byte {
// AclAccountInvite contains the public invite key, the private part of which is sent to the user directly // AclAccountInvite contains the public invite key, the private part of which is sent to the user directly
type AclAccountInvite struct { type AclAccountInvite struct {
InviteKey []byte `protobuf:"bytes,1,opt,name=inviteKey,proto3" json:"inviteKey,omitempty"` InviteKey []byte `protobuf:"bytes,1,opt,name=inviteKey,proto3" json:"inviteKey,omitempty"`
InviteType AclInviteType `protobuf:"varint,2,opt,name=inviteType,proto3,enum=aclrecord.AclInviteType" json:"inviteType,omitempty"` InviteType AclInviteType `protobuf:"varint,2,opt,name=inviteType,proto3,enum=aclrecord.AclInviteType" json:"inviteType,omitempty"`
Permissions AclUserPermissions `protobuf:"varint,3,opt,name=permissions,proto3,enum=aclrecord.AclUserPermissions" json:"permissions,omitempty"`
} }
func (m *AclAccountInvite) Reset() { *m = AclAccountInvite{} } func (m *AclAccountInvite) Reset() { *m = AclAccountInvite{} }
@ -263,6 +264,13 @@ func (m *AclAccountInvite) GetInviteType() AclInviteType {
return AclInviteType_RequestToJoin return AclInviteType_RequestToJoin
} }
func (m *AclAccountInvite) GetPermissions() AclUserPermissions {
if m != nil {
return m.Permissions
}
return AclUserPermissions_None
}
// AclAccountRequestJoin contains the reference to the invite record and the data of the person who wants to join, confirmed by the private invite key // AclAccountRequestJoin contains the reference to the invite record and the data of the person who wants to join, confirmed by the private invite key
type AclAccountRequestJoin struct { type AclAccountRequestJoin struct {
InviteIdentity []byte `protobuf:"bytes,1,opt,name=inviteIdentity,proto3" json:"inviteIdentity,omitempty"` InviteIdentity []byte `protobuf:"bytes,1,opt,name=inviteIdentity,proto3" json:"inviteIdentity,omitempty"`
@ -344,7 +352,7 @@ func (m *AclAccountRequestJoin) GetMetadata() []byte {
// AclInviteJoin contains the reference to the invite record and the data of the person who wants to join, confirmed by the private invite key // AclInviteJoin contains the reference to the invite record and the data of the person who wants to join, confirmed by the private invite key
// The person must encrypt the key with its own public key // The person must encrypt the key with its own public key
type AclInviteJoin struct { type AclInviteJoin struct {
InviteIdentity []byte `protobuf:"bytes,1,opt,name=inviteIdentity,proto3" json:"inviteIdentity,omitempty"` Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
InviteRecordId string `protobuf:"bytes,2,opt,name=inviteRecordId,proto3" json:"inviteRecordId,omitempty"` InviteRecordId string `protobuf:"bytes,2,opt,name=inviteRecordId,proto3" json:"inviteRecordId,omitempty"`
InviteIdentitySignature []byte `protobuf:"bytes,3,opt,name=inviteIdentitySignature,proto3" json:"inviteIdentitySignature,omitempty"` InviteIdentitySignature []byte `protobuf:"bytes,3,opt,name=inviteIdentitySignature,proto3" json:"inviteIdentitySignature,omitempty"`
// Metadata is encrypted with metadata key of the space // Metadata is encrypted with metadata key of the space
@ -393,9 +401,9 @@ func (m *AclInviteJoin) XXX_DiscardUnknown() {
var xxx_messageInfo_AclInviteJoin proto.InternalMessageInfo var xxx_messageInfo_AclInviteJoin proto.InternalMessageInfo
func (m *AclInviteJoin) GetInviteIdentity() []byte { func (m *AclInviteJoin) GetIdentity() []byte {
if m != nil { if m != nil {
return m.InviteIdentity return m.Identity
} }
return nil return nil
} }
@ -1178,6 +1186,7 @@ type AclContentValue struct {
// *AclContentValue_PermissionChanges // *AclContentValue_PermissionChanges
// *AclContentValue_AccountsAdd // *AclContentValue_AccountsAdd
// *AclContentValue_RequestCancel // *AclContentValue_RequestCancel
// *AclContentValue_InviteJoin
Value isAclContentValueValue `protobuf_oneof:"value"` Value isAclContentValueValue `protobuf_oneof:"value"`
} }
@ -1264,6 +1273,9 @@ type AclContentValue_AccountsAdd struct {
type AclContentValue_RequestCancel struct { type AclContentValue_RequestCancel struct {
RequestCancel *AclAccountRequestCancel `protobuf:"bytes,12,opt,name=requestCancel,proto3,oneof" json:"requestCancel,omitempty"` RequestCancel *AclAccountRequestCancel `protobuf:"bytes,12,opt,name=requestCancel,proto3,oneof" json:"requestCancel,omitempty"`
} }
type AclContentValue_InviteJoin struct {
InviteJoin *AclInviteJoin `protobuf:"bytes,13,opt,name=inviteJoin,proto3,oneof" json:"inviteJoin,omitempty"`
}
func (*AclContentValue_Invite) isAclContentValueValue() {} func (*AclContentValue_Invite) isAclContentValueValue() {}
func (*AclContentValue_InviteRevoke) isAclContentValueValue() {} func (*AclContentValue_InviteRevoke) isAclContentValueValue() {}
@ -1277,6 +1289,7 @@ func (*AclContentValue_AccountRequestRemove) isAclContentValueValue() {}
func (*AclContentValue_PermissionChanges) isAclContentValueValue() {} func (*AclContentValue_PermissionChanges) isAclContentValueValue() {}
func (*AclContentValue_AccountsAdd) isAclContentValueValue() {} func (*AclContentValue_AccountsAdd) isAclContentValueValue() {}
func (*AclContentValue_RequestCancel) isAclContentValueValue() {} func (*AclContentValue_RequestCancel) isAclContentValueValue() {}
func (*AclContentValue_InviteJoin) isAclContentValueValue() {}
func (m *AclContentValue) GetValue() isAclContentValueValue { func (m *AclContentValue) GetValue() isAclContentValueValue {
if m != nil { if m != nil {
@ -1369,6 +1382,13 @@ func (m *AclContentValue) GetRequestCancel() *AclAccountRequestCancel {
return nil return nil
} }
func (m *AclContentValue) GetInviteJoin() *AclInviteJoin {
if x, ok := m.GetValue().(*AclContentValue_InviteJoin); ok {
return x.InviteJoin
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package. // XXX_OneofWrappers is for the internal use of the proto package.
func (*AclContentValue) XXX_OneofWrappers() []interface{} { func (*AclContentValue) XXX_OneofWrappers() []interface{} {
return []interface{}{ return []interface{}{
@ -1384,6 +1404,7 @@ func (*AclContentValue) XXX_OneofWrappers() []interface{} {
(*AclContentValue_PermissionChanges)(nil), (*AclContentValue_PermissionChanges)(nil),
(*AclContentValue_AccountsAdd)(nil), (*AclContentValue_AccountsAdd)(nil),
(*AclContentValue_RequestCancel)(nil), (*AclContentValue_RequestCancel)(nil),
(*AclContentValue_InviteJoin)(nil),
} }
} }
@ -1468,76 +1489,78 @@ func init() {
} }
var fileDescriptor_c8e9f754f34e929b = []byte{ var fileDescriptor_c8e9f754f34e929b = []byte{
// 1096 bytes of a gzipped FileDescriptorProto // 1122 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0x4f, 0x8f, 0xdb, 0x44, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xdf, 0x6e, 0xdb, 0x54,
0x14, 0xb7, 0x93, 0xcd, 0x66, 0xf3, 0xb2, 0x9b, 0x7a, 0xa7, 0xd0, 0xba, 0x5b, 0x88, 0x82, 0x51, 0x18, 0xb7, 0x93, 0xa6, 0x69, 0xbe, 0x34, 0x99, 0x7b, 0x06, 0x9b, 0xd7, 0x41, 0x14, 0x8c, 0x36,
0xab, 0x68, 0x85, 0xba, 0x28, 0x68, 0xab, 0xaa, 0x02, 0xb6, 0x6e, 0xb6, 0x6a, 0xd2, 0xaa, 0x50, 0x45, 0x15, 0x5a, 0x51, 0x50, 0xa7, 0xa9, 0x02, 0x3a, 0x2f, 0x9d, 0x96, 0x6c, 0x1a, 0x4c, 0x67,
0x4d, 0x4b, 0x8b, 0x90, 0x40, 0xf2, 0xda, 0xa3, 0xe2, 0xe2, 0x8c, 0xc3, 0x78, 0x12, 0x94, 0x6f, 0x63, 0x43, 0x48, 0x20, 0xb9, 0xf6, 0xd1, 0x30, 0x38, 0xc7, 0xc1, 0x3e, 0x09, 0xca, 0x5b, 0xf0,
0xc1, 0x8d, 0xef, 0xc0, 0x99, 0x2b, 0x77, 0x0e, 0x1c, 0x7a, 0xe4,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x28, 0xc8, 0x84, 0x56, 0x20, 0x17, 0x57, 0x14, 0xa2, 0xd9, 0xbf,
0xde, 0xad, 0x5f, 0xea, 0x70, 0xc9, 0x76, 0x83, 0x7e, 0x48, 0x39, 0xa1, 0xfc, 0x85, 0x13, 0x4c, 0x99, 0x75, 0x9b, 0xa9, 0x3f, 0xce, 0x6a, 0x18, 0x37, 0x0a, 0x50, 0x15, 0x79, 0x37, 0xfe, 0xac,
0x08, 0x3a, 0x84, 0xcd, 0x38, 0x66, 0xd9, 0x2d, 0x0b, 0xae, 0x72, 0xf7, 0xd3, 0x40, 0xc3, 0x89, 0xc3, 0x15, 0xd3, 0xf6, 0x06, 0x3e, 0x65, 0x84, 0xb2, 0x97, 0x96, 0x37, 0x25, 0xe8, 0x00, 0x36,
0x30, 0x7a, 0x08, 0xdb, 0xbe, 0x72, 0x67, 0x25, 0x71, 0x7e, 0xb0, 0x42, 0x39, 0x16, 0x1c, 0x68, 0xa3, 0x98, 0x05, 0x5a, 0x96, 0x5c, 0x65, 0xce, 0xa7, 0xa1, 0x82, 0x63, 0x61, 0xf4, 0x08, 0xb6,
0x38, 0xa7, 0x88, 0x8e, 0xa1, 0xc9, 0xb2, 0xa5, 0x2d, 0x61, 0x6c, 0xf6, 0x3a, 0xa5, 0x76, 0x94, 0x5d, 0xe9, 0xcc, 0x8a, 0xe3, 0x7c, 0x6f, 0x85, 0x72, 0x24, 0x38, 0x54, 0x70, 0x46, 0x11, 0x1d,
0xe5, 0x3e, 0xd0, 0xb0, 0xaa, 0x86, 0x1e, 0x89, 0xba, 0x29, 0x6b, 0x45, 0xe2, 0xda, 0xec, 0x59, 0x43, 0x33, 0x48, 0x17, 0xb5, 0x68, 0x63, 0xb3, 0xdf, 0x2d, 0xb4, 0x23, 0x2d, 0xf4, 0xa1, 0x82,
0xab, 0xec, 0xc4, 0x92, 0x03, 0x0d, 0xe7, 0x55, 0xd1, 0x33, 0x30, 0xc6, 0x85, 0xa9, 0x92, 0x9b, 0x65, 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ac, 0xa3, 0xfe, 0x73, 0xd6, 0x51, 0x7f, 0x3a,
0x02, 0xe7, 0xf9, 0x94, 0x0f, 0x0e, 0x00, 0x00, 0xef, 0x28, 0xa7, 0xe7, 0x1d, 0xe5, 0xef, 0xf3, 0x8e, 0xf2, 0xd5, 0xad, 0xb5, 0xbe, 0x28, 0x4f,
0x36, 0xc5, 0xcf, 0x47, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x48, 0xe7, 0x67, 0x87, 0x81, 0x0e,
0x00, 0x00,
} }
func (m *AclRoot) Marshal() (dAtA []byte, err error) { func (m *AclRoot) Marshal() (dAtA []byte, err error) {
@ -1644,6 +1667,11 @@ func (m *AclAccountInvite) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Permissions != 0 {
i = encodeVarintAclrecord(dAtA, i, uint64(m.Permissions))
i--
dAtA[i] = 0x18
}
if m.InviteType != 0 { if m.InviteType != 0 {
i = encodeVarintAclrecord(dAtA, i, uint64(m.InviteType)) i = encodeVarintAclrecord(dAtA, i, uint64(m.InviteType))
i-- i--
@ -1758,10 +1786,10 @@ func (m *AclInviteJoin) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i-- i--
dAtA[i] = 0x12 dAtA[i] = 0x12
} }
if len(m.InviteIdentity) > 0 { if len(m.Identity) > 0 {
i -= len(m.InviteIdentity) i -= len(m.Identity)
copy(dAtA[i:], m.InviteIdentity) copy(dAtA[i:], m.Identity)
i = encodeVarintAclrecord(dAtA, i, uint64(len(m.InviteIdentity))) i = encodeVarintAclrecord(dAtA, i, uint64(len(m.Identity)))
i-- i--
dAtA[i] = 0xa dAtA[i] = 0xa
} }
@ -2525,6 +2553,27 @@ func (m *AclContentValue_RequestCancel) MarshalToSizedBuffer(dAtA []byte) (int,
} }
return len(dAtA) - i, nil return len(dAtA) - i, nil
} }
func (m *AclContentValue_InviteJoin) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *AclContentValue_InviteJoin) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
if m.InviteJoin != nil {
{
size, err := m.InviteJoin.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintAclrecord(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x6a
}
return len(dAtA) - i, nil
}
func (m *AclData) Marshal() (dAtA []byte, err error) { func (m *AclData) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
@ -2630,6 +2679,9 @@ func (m *AclAccountInvite) Size() (n int) {
if m.InviteType != 0 { if m.InviteType != 0 {
n += 1 + sovAclrecord(uint64(m.InviteType)) n += 1 + sovAclrecord(uint64(m.InviteType))
} }
if m.Permissions != 0 {
n += 1 + sovAclrecord(uint64(m.Permissions))
}
return n return n
} }
@ -2664,7 +2716,7 @@ func (m *AclInviteJoin) Size() (n int) {
} }
var l int var l int
_ = l _ = l
l = len(m.InviteIdentity) l = len(m.Identity)
if l > 0 { if l > 0 {
n += 1 + l + sovAclrecord(uint64(l)) n += 1 + l + sovAclrecord(uint64(l))
} }
@ -3054,6 +3106,18 @@ func (m *AclContentValue_RequestCancel) Size() (n int) {
} }
return n return n
} }
func (m *AclContentValue_InviteJoin) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.InviteJoin != nil {
l = m.InviteJoin.Size()
n += 1 + l + sovAclrecord(uint64(l))
}
return n
}
func (m *AclData) Size() (n int) { func (m *AclData) Size() (n int) {
if m == nil { if m == nil {
return 0 return 0
@ -3496,6 +3560,25 @@ func (m *AclAccountInvite) Unmarshal(dAtA []byte) error {
break break
} }
} }
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType)
}
m.Permissions = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAclrecord
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Permissions |= AclUserPermissions(b&0x7F) << shift
if b < 0x80 {
break
}
}
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipAclrecord(dAtA[iNdEx:]) skippy, err := skipAclrecord(dAtA[iNdEx:])
@ -3732,7 +3815,7 @@ func (m *AclInviteJoin) Unmarshal(dAtA []byte) error {
switch fieldNum { switch fieldNum {
case 1: case 1:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field InviteIdentity", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Identity", wireType)
} }
var byteLen int var byteLen int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -3759,9 +3842,9 @@ func (m *AclInviteJoin) Unmarshal(dAtA []byte) error {
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
m.InviteIdentity = append(m.InviteIdentity[:0], dAtA[iNdEx:postIndex]...) m.Identity = append(m.Identity[:0], dAtA[iNdEx:postIndex]...)
if m.InviteIdentity == nil { if m.Identity == nil {
m.InviteIdentity = []byte{} m.Identity = []byte{}
} }
iNdEx = postIndex iNdEx = postIndex
case 2: case 2:
@ -5731,6 +5814,41 @@ func (m *AclContentValue) Unmarshal(dAtA []byte) error {
} }
m.Value = &AclContentValue_RequestCancel{v} m.Value = &AclContentValue_RequestCancel{v}
iNdEx = postIndex iNdEx = postIndex
case 13:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field InviteJoin", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAclrecord
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthAclrecord
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthAclrecord
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
v := &AclInviteJoin{}
if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
m.Value = &AclContentValue_InviteJoin{v}
iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipAclrecord(dAtA[iNdEx:]) skippy, err := skipAclrecord(dAtA[iNdEx:])

View file

@ -19,6 +19,7 @@ message AclRoot {
message AclAccountInvite { message AclAccountInvite {
bytes inviteKey = 1; bytes inviteKey = 1;
AclInviteType inviteType = 2; AclInviteType inviteType = 2;
AclUserPermissions permissions = 3;
} }
enum AclInviteType { enum AclInviteType {
@ -38,7 +39,7 @@ message AclAccountRequestJoin {
// AclInviteJoin contains the reference to the invite record and the data of the person who wants to join, confirmed by the private invite key // AclInviteJoin contains the reference to the invite record and the data of the person who wants to join, confirmed by the private invite key
// The person must encrypt the key with its own public key // The person must encrypt the key with its own public key
message AclInviteJoin { message AclInviteJoin {
bytes inviteIdentity = 1; bytes identity = 1;
string inviteRecordId = 2; string inviteRecordId = 2;
bytes inviteIdentitySignature = 3; bytes inviteIdentitySignature = 3;
// Metadata is encrypted with metadata key of the space // Metadata is encrypted with metadata key of the space
@ -136,6 +137,7 @@ message AclContentValue {
AclAccountPermissionChanges permissionChanges = 10; AclAccountPermissionChanges permissionChanges = 10;
AclAccountsAdd accountsAdd = 11; AclAccountsAdd accountsAdd = 11;
AclAccountRequestCancel requestCancel = 12; AclAccountRequestCancel requestCancel = 12;
AclInviteJoin inviteJoin = 13;
} }
} }

View file

@ -52,8 +52,9 @@ type AclKeys struct {
} }
type Invite struct { type Invite struct {
Key crypto.PubKey Key crypto.PubKey
Type aclrecordproto.AclInviteType Type aclrecordproto.AclInviteType
Permissions AclPermissions
} }
type AclState struct { type AclState struct {
@ -465,6 +466,8 @@ func (st *AclState) Copy() *AclState {
func (st *AclState) applyChangeContent(ch *aclrecordproto.AclContentValue, record *AclRecord) error { func (st *AclState) applyChangeContent(ch *aclrecordproto.AclContentValue, record *AclRecord) error {
switch { switch {
case ch.GetInviteJoin() != nil:
return st.applyInviteJoin(ch.GetInviteJoin(), record)
case ch.GetPermissionChange() != nil: case ch.GetPermissionChange() != nil:
return st.applyPermissionChange(ch.GetPermissionChange(), record) return st.applyPermissionChange(ch.GetPermissionChange(), record)
case ch.GetInvite() != nil: case ch.GetInvite() != nil:
@ -535,8 +538,9 @@ func (st *AclState) applyInvite(ch *aclrecordproto.AclAccountInvite, record *Acl
return err return err
} }
st.invites[record.Id] = Invite{ st.invites[record.Id] = Invite{
Key: inviteKey, Key: inviteKey,
Type: ch.InviteType, Type: ch.InviteType,
Permissions: AclPermissions(ch.Permissions),
} }
return nil return nil
} }
@ -667,6 +671,44 @@ func (st *AclState) applyRequestAccept(ch *aclrecordproto.AclAccountRequestAccep
return st.unpackAllKeys(ch.EncryptedReadKey) return st.unpackAllKeys(ch.EncryptedReadKey)
} }
func (st *AclState) applyInviteJoin(ch *aclrecordproto.AclInviteJoin, record *AclRecord) error {
identity, err := st.keyStore.PubKeyFromProto(ch.Identity)
if err != nil {
return err
}
inviteRecord, _ := st.invites[ch.InviteRecordId]
pKeyString := mapKeyFromPubKey(identity)
state, exists := st.accountStates[pKeyString]
if !exists {
st.accountStates[pKeyString] = AccountState{
PubKey: identity,
Permissions: inviteRecord.Permissions,
RequestMetadata: ch.Metadata,
KeyRecordId: st.CurrentReadKeyId(),
Status: StatusActive,
PermissionChanges: []PermissionChange{
{
Permission: inviteRecord.Permissions,
RecordId: record.Id,
},
},
}
} else {
st.accountStates[pKeyString] = AccountState{
PubKey: identity,
Permissions: inviteRecord.Permissions,
RequestMetadata: ch.Metadata,
KeyRecordId: st.CurrentReadKeyId(),
Status: StatusActive,
PermissionChanges: append(state.PermissionChanges, PermissionChange{
Permission: inviteRecord.Permissions,
RecordId: record.Id,
}),
}
}
return st.unpackAllKeys(ch.EncryptedReadKey)
}
func (st *AclState) unpackAllKeys(rk []byte) error { func (st *AclState) unpackAllKeys(rk []byte) error {
iterReadKey, err := st.unmarshallDecryptReadKey(rk, st.key.Decrypt) iterReadKey, err := st.unmarshallDecryptReadKey(rk, st.key.Decrypt)
if err != nil { if err != nil {

View file

@ -152,6 +152,10 @@ func (c *contentValidator) ValidateInvite(ch *aclrecordproto.AclAccountInvite, a
if !c.aclState.Permissions(authorIdentity).CanManageAccounts() { if !c.aclState.Permissions(authorIdentity).CanManageAccounts() {
return ErrInsufficientPermissions return ErrInsufficientPermissions
} }
if ch.InviteType == aclrecordproto.AclInviteType_AnyoneCanJoin &&
(AclPermissions(ch.Permissions).IsOwner() || AclPermissions(ch.Permissions).NoPermissions()) {
return ErrInsufficientPermissions
}
_, err = c.keyStore.PubKeyFromProto(ch.InviteKey) _, err = c.keyStore.PubKeyFromProto(ch.InviteKey)
return return
} }