caldav, carddav: add current-user-privilege-set
This commit is contained in:
parent
0e74e6df11
commit
a16253aa97
@ -546,6 +546,13 @@ func (b *backend) propFindCalendar(ctx context.Context, propfind *internal.PropF
|
||||
Comp: components,
|
||||
}, nil
|
||||
},
|
||||
// TODO: Gather UserPrivilege from backend to control read-and-write
|
||||
internal.CurrentUserPrivilegeSetName: internal.PropFindValue(&internal.CurrentUserPrivilegeSet{
|
||||
Privilege: []internal.Privilege{{
|
||||
Read: &struct{}{},
|
||||
Write: &struct{}{},
|
||||
}},
|
||||
}),
|
||||
}
|
||||
|
||||
if cal.Name != "" {
|
||||
|
||||
@ -497,6 +497,13 @@ func (b *backend) propFindAddressBook(ctx context.Context, propfind *internal.Pr
|
||||
{ContentType: vcard.MIMEType, Version: "4.0"},
|
||||
},
|
||||
}),
|
||||
// TODO: Gather UserPrivilege from backend to control read-and-write
|
||||
internal.CurrentUserPrivilegeSetName: internal.PropFindValue(&internal.CurrentUserPrivilegeSet{
|
||||
Privilege: []internal.Privilege{{
|
||||
Read: &struct{}{},
|
||||
Write: &struct{}{},
|
||||
}},
|
||||
}),
|
||||
}
|
||||
|
||||
if ab.Name != "" {
|
||||
|
||||
@ -24,7 +24,8 @@ var (
|
||||
CollectionName = xml.Name{Namespace, "collection"}
|
||||
PrincipalName = xml.Name{Namespace, "principal"}
|
||||
|
||||
CurrentUserPrincipalName = xml.Name{Namespace, "current-user-principal"}
|
||||
CurrentUserPrincipalName = xml.Name{Namespace, "current-user-principal"}
|
||||
CurrentUserPrivilegeSetName = xml.Name{Namespace, "current-user-privilege-set"}
|
||||
)
|
||||
|
||||
type Status struct {
|
||||
@ -451,3 +452,16 @@ type Limit struct {
|
||||
XMLName xml.Name `xml:"DAV: limit"`
|
||||
NResults uint `xml:"nresults"`
|
||||
}
|
||||
|
||||
// https://tools.ietf.org/html/rfc3744#section-5.4
|
||||
type CurrentUserPrivilegeSet struct {
|
||||
XMLName xml.Name `xml:"DAV: current-user-privilege-set"`
|
||||
Privilege []Privilege
|
||||
}
|
||||
|
||||
// https://tools.ietf.org/html/rfc3744#section-5.4
|
||||
type Privilege struct {
|
||||
XMLName xml.Name `xml:"DAV: privilege"`
|
||||
Read *struct{} `xml:"DAV: read,omitempty"`
|
||||
Write *struct{} `xml:"DAV: write,omitempty"`
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user