carddav: acl readonly (for Thunderbird)
This commit is contained in:
@@ -496,13 +496,23 @@ func (b *backend) propFindAddressBook(ctx context.Context, propfind *internal.Pr
|
||||
}
|
||||
return &internal.CurrentUserPrincipal{Href: internal.Href{Path: path}}, nil
|
||||
},
|
||||
internal.ResourceTypeName: internal.PropFindValue(internal.NewResourceType(internal.CollectionName, addressBookName)),
|
||||
supportedAddressDataName: internal.PropFindValue(&supportedAddressData{
|
||||
Types: []addressDataType{
|
||||
{ContentType: vcard.MIMEType, Version: "3.0"},
|
||||
{ContentType: vcard.MIMEType, Version: "4.0"},
|
||||
},
|
||||
}),
|
||||
internal.ResourceTypeName: func(*internal.RawXMLValue) (interface{}, error) {
|
||||
return internal.NewResourceType(internal.CollectionName, addressBookName), nil
|
||||
},
|
||||
supportedAddressDataName: func(*internal.RawXMLValue) (interface{}, error) {
|
||||
return &supportedAddressData{
|
||||
Types: []addressDataType{
|
||||
{ContentType: vcard.MIMEType, Version: "3.0"},
|
||||
{ContentType: vcard.MIMEType, Version: "4.0"},
|
||||
},
|
||||
}, nil
|
||||
},
|
||||
internal.CurrentUserPrivilegeSetName: func(*internal.RawXMLValue) (interface{}, error) {
|
||||
if ab.ReadOnly {
|
||||
return &internal.CurrentUserPrivilegeSetReadOnly, nil
|
||||
}
|
||||
return &internal.CurrentUserPrivilegeSetReadWrite, nil
|
||||
},
|
||||
}
|
||||
|
||||
if ab.Name != "" {
|
||||
@@ -569,6 +579,12 @@ func (b *backend) propFindAddressObject(ctx context.Context, propfind *internal.
|
||||
|
||||
return &addressDataResp{Data: buf.Bytes()}, nil
|
||||
},
|
||||
internal.CurrentUserPrivilegeSetName: func(*internal.RawXMLValue) (interface{}, error) {
|
||||
if ao.ReadOnly {
|
||||
return &internal.CurrentUserPrivilegeSetReadOnly, nil
|
||||
}
|
||||
return &internal.CurrentUserPrivilegeSetReadWrite, nil
|
||||
},
|
||||
}
|
||||
|
||||
if ao.ContentLength > 0 {
|
||||
|
Reference in New Issue
Block a user