-1

I'm in the first steps with webdav.

To restrict access to a folder it's possible to use:

Require user myownuser

Is it possible to allow access to a group of users (like samba does)?

Sven
  • 97,248
  • 13
  • 177
  • 225
KcFnMi
  • 119
  • 8

2 Answers2

2

I assume you are using Apache httpd 2.4 as your webdav server.

In that case, you can use the mod_authz_dbm module or the mod_authnz_ldap module to provide user and group information to Apache and use this in your <Directory> statement for access control.

Something like this (untested and copied from the docs):

<Directory "/usr/local/apache2/htdocs/foo">
    Require all granted
    Dav On

    AuthType Basic
    AuthName DAV
    AuthBasicProvider dbm
    AuthDBMUserFile "site/data/users"
    AuthDBMGroupFile "site/data/users"
    Require dbm-group admin


</Directory>
Sven
  • 97,248
  • 13
  • 177
  • 225
  • May I ask your opinion on this https://superuser.com/questions/1194753/webdav-directory-vs-location also? – KcFnMi Apr 02 '17 at 12:20
  • 1
    http://serverfault.com/questions/196957/difference-between-location-and-directory-apache-directives – Sven Apr 02 '17 at 12:21
  • 1
    In this case, `` is the way to go, as you want to protect the content of the directory regardless of the URL which is used to access it. – Sven Apr 02 '17 at 12:22
  • Another one, https://superuser.com/questions/1194676/webdav-linking-to-a-folder-in-users-home, please. – KcFnMi Apr 02 '17 at 12:23
1

Instead of mod_authz_dbm and mod_authnz_ldap, I'm going with mod_authz_groupfile. Curious about the possible disadvantages of this in relation to the others?

 Alias /webdav/tmp /var/www/webdav/tmp
 <Location /webdav/tmp>
     DAV On
     AuthType Digest
     AuthName "webdav"
     AuthUserFile /etc/apache2/users.password
     AuthGroupFile /etc/apache2/groups
     Require group mygorup
 </Location>
KcFnMi
  • 119
  • 8