0

I'm trying to have a directory structure where each user has a directory under /restricted that only they can access, but the "admin" user has access to all and OPTIONS requests aren't restricted.

Here's my config right now:

<Directory "/restricted">
  <LimitExcept OPTIONS>
    Require user admin
  </LimitExcept>
</Directory>

<Directory "/restricted/foo">
  <LimitExcept OPTIONS>
    Require user foo
  </LimitExcept>
</Directory>

<Directory "/restricted/bar">
  <LimitExcept OPTIONS>
    Require user bar
  </LimitExcept>
</Directory>

This doesn't work since (to the best of my understanding) Require directives from subfolders override the Require from the parent. This sounds like a good default, but I was wondering if I can override that behavior somehow?

I'm aware I can also just include "admin" in every Require, e.g. Require user bar admin, but this seems a bit error-prone, so I'd avoid it if possible.

1 Answer 1

3

"Authmerging Or" in every sub-directory, would that be less error prone?

<Directory "/restricted">
  <LimitExcept OPTIONS>
    Require user admin
  </LimitExcept>
</Directory>

<Directory "/restricted/foo">
  AuthMerging Or
  <LimitExcept OPTIONS>
    Require user foo
  </LimitExcept>
</Directory>

<Directory "/restricted/bar">
  AuthMerging Or
  <LimitExcept OPTIONS>
    Require user bar
  </LimitExcept>
</Directory>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .