On Thursday, October 23, 2014 5:24:29 AM UTC-4, Redlorry wrote:
>
> Hi all,
>
> I've setup a virtual file system using Sabredav which works great. I've 
> got all the reads, writes, moves, auth etc working via the database however 
> I'd like be able to do 2 more things, which I think are along the same 
> lines:
>
> 1) In Windows when the drive is mounted using NetDrive, it shows used and 
> total space on the drive icon. This by default is 1TB. I'd like to control 
> this so I can set this to whatever space the user has. I've found 
> {DAV:}quota-used-bytes & {DAV:}quota-available-bytes properties, but how 
> can I set them? I assume they need set on the root node.
>

In your VirtualCollection, implement Sabre\DAV\IQuota:

https://github.com/fruux/sabre-dav/blob/master/lib/DAV/IQuota.php
 

>
> 2) A user may only have read only access so I'd like to set all files and 
> directories with a ro property. I currently have a check on each of the 
> sabredav write functions (put, setName, delete etc) which returns a 
> Forbidden Exception, however Windows doesn't handle it very quickly. If I 
> can set each file as read only then windows should handle it better. The 
> read only property I've found is {DAV:}isreadonly.
>
> Some example code so you can see the general structure. I've removed 
> anything which isn't relevant.
>

The 'standard webdav' way is to use {DAV:}current-user-privilege-set. You 
can enable this by using Sabre\DAVACL\IACL.
If you enable that, then you also no longer have to do access control 
checks on every single method, because the ACL plugin will do that for you 
and send back appropriate error codes (403 really).

However, Windows won't do anything with those properties. (Modern) windows 
clients use a different property, namely:

{urn:schemas-microsoft-com:}Win32FileAttributes

I don't think they are able to use {DAV:}readonly, but I'm not sure. I'm 
also not sure what the format is of this Win32FileAttributes property.

To send back custom properties from a Collection or File object, implement 
Sabre\DAV\IProperties.

Evert

-- 
You received this message because you are subscribed to the Google Groups 
"SabreDAV Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sabredav-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sabredav-discuss/f015391a-2e00-4bb5-8272-4c007de66b0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to