654734c34540d66c4550b856dd1a278779b34138nd<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
654734c34540d66c4550b856dd1a278779b34138nd<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
031b91a62d25106ae69d4693475c79618dd5e884fielding Licensed to the Apache Software Foundation (ASF) under one or more
031b91a62d25106ae69d4693475c79618dd5e884fielding contributor license agreements. See the NOTICE file distributed with
031b91a62d25106ae69d4693475c79618dd5e884fielding this work for additional information regarding copyright ownership.
031b91a62d25106ae69d4693475c79618dd5e884fielding The ASF licenses this file to You under the Apache License, Version 2.0
031b91a62d25106ae69d4693475c79618dd5e884fielding (the "License"); you may not use this file except in compliance with
031b91a62d25106ae69d4693475c79618dd5e884fielding the License. You may obtain a copy of the License at
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Unless required by applicable law or agreed to in writing, software
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd distributed under the License is distributed on an "AS IS" BASIS,
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd See the License for the specific language governing permissions and
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd limitations under the License.
654734c34540d66c4550b856dd1a278779b34138nd<description>Authorization based on file ownership</description>
654734c34540d66c4550b856dd1a278779b34138nd <p>This module authorizes access to files by comparing the userid used
654734c34540d66c4550b856dd1a278779b34138nd for HTTP authentication (the web userid) with the file-system owner or
654734c34540d66c4550b856dd1a278779b34138nd group of the requested file. The supplied username and password
654734c34540d66c4550b856dd1a278779b34138nd must be already properly verified by an authentication module,
654734c34540d66c4550b856dd1a278779b34138nd <module>mod_auth_digest</module>. <module>mod_authz_owner</module>
8b226aa868d55e93fc6da72323a5e1542027c411rbowen recognizes two arguments for the <directive module="mod_authz_core"
654734c34540d66c4550b856dd1a278779b34138nd >Require</directive> directive, <code>file-owner</code> and
654734c34540d66c4550b856dd1a278779b34138nd <dd>The supplied web-username must match the system's name for the
654734c34540d66c4550b856dd1a278779b34138nd owner of the file being requested. That is, if the operating system
654734c34540d66c4550b856dd1a278779b34138nd says the requested file is owned by <code>jones</code>, then the
654734c34540d66c4550b856dd1a278779b34138nd username used to access it through the web must be <code>jones</code>
654734c34540d66c4550b856dd1a278779b34138nd as well.</dd>
654734c34540d66c4550b856dd1a278779b34138nd <dd>The name of the system group that owns the file must be present
654734c34540d66c4550b856dd1a278779b34138nd in a group database, which is provided, for example, by <module
654734c34540d66c4550b856dd1a278779b34138nd >mod_authz_groupfile</module> or <module>mod_authz_dbm</module>,
654734c34540d66c4550b856dd1a278779b34138nd and the web-username must be a member of that group. For example, if
654734c34540d66c4550b856dd1a278779b34138nd the operating system says the requested file is owned by (system)
654734c34540d66c4550b856dd1a278779b34138nd group <code>accounts</code>, the group <code>accounts</code> must
654734c34540d66c4550b856dd1a278779b34138nd appear in the group database and the web-username used in the request
654734c34540d66c4550b856dd1a278779b34138nd must be a member of that group.</dd>
654734c34540d66c4550b856dd1a278779b34138nd <p>If <module>mod_authz_owner</module> is used in order to authorize
654734c34540d66c4550b856dd1a278779b34138nd a resource that is not actually present in the filesystem
654734c34540d66c4550b856dd1a278779b34138nd (<em>i.e.</em> a virtual resource), it will deny the access.</p>
654734c34540d66c4550b856dd1a278779b34138nd href="/content-negotiation.html#multiviews">content negotiated
9cd3b05d7b70f07a742bbaf548fa4fa2bdbe5ce6noodl<seealso><directive module="mod_authz_core">Require</directive></seealso>
654734c34540d66c4550b856dd1a278779b34138nd<section id="examples"><title>Configuration Examples</title>
67c026fea89b4faf173772b5944b6aa006ca6eb0nd <section id="examples.file-owner"><title>Require file-owner</title>
654734c34540d66c4550b856dd1a278779b34138nd <p>Consider a multi-user system running the Apache Web server, with
654734c34540d66c4550b856dd1a278779b34138nd each user having his or her own files in <code
654734c34540d66c4550b856dd1a278779b34138nd >~/public_html/private</code>. Assuming that there is a single
654734c34540d66c4550b856dd1a278779b34138nd <directive module="mod_authn_dbm">AuthDBMUserFile</directive> database
654734c34540d66c4550b856dd1a278779b34138nd that lists all of their web-usernames, and that these usernames match
654734c34540d66c4550b856dd1a278779b34138nd the system's usernames that actually own the files on the server, then
654734c34540d66c4550b856dd1a278779b34138nd the following stanza would allow only the user himself access to his
654734c34540d66c4550b856dd1a278779b34138nd own files. User <code>jones</code> would not be allowed to access
654734c34540d66c4550b856dd1a278779b34138nd files in <code>/home/smith/public_html/private</code> unless they
654734c34540d66c4550b856dd1a278779b34138nd were owned by <code>jones</code> instead of <code>smith</code>.</p>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh AuthType Basic
3658293f56f1683ca41e3bc5b70d98b203d8004bcoar AuthName "MyPrivateFiles"
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh AuthBasicProvider dbm
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh Require file-owner
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh</Directory>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh </highlight>
654734c34540d66c4550b856dd1a278779b34138nd </section>
67c026fea89b4faf173772b5944b6aa006ca6eb0nd <section id="examples.file-group"><title>Require file-group</title>
654734c34540d66c4550b856dd1a278779b34138nd <p>Consider a system similar to the one described above, but with
654734c34540d66c4550b856dd1a278779b34138nd some users that share their project files in
654734c34540d66c4550b856dd1a278779b34138nd <code>~/public_html/project-foo</code>. The files are owned by the
654734c34540d66c4550b856dd1a278779b34138nd system group <code>foo</code> and there is a single <directive
654734c34540d66c4550b856dd1a278779b34138nd module="mod_authz_dbm">AuthDBMGroupFile</directive> database that
654734c34540d66c4550b856dd1a278779b34138nd contains all of the web-usernames and their group membership,
654734c34540d66c4550b856dd1a278779b34138nd <em>i.e.</em> they must be at least member of a group named
654734c34540d66c4550b856dd1a278779b34138nd <code>foo</code>. So if <code>jones</code> and <code>smith</code>
654734c34540d66c4550b856dd1a278779b34138nd are both member of the group <code>foo</code>, then both will be
654734c34540d66c4550b856dd1a278779b34138nd authorized to access the <code>project-foo</code> directories of
654734c34540d66c4550b856dd1a278779b34138nd each other.</p>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh AuthType Basic
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh AuthName "Project Foo Files"
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh AuthBasicProvider dbm
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh Require file-group
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh</Directory>
6f10385908fbdfd4849e4bc50e690ee54c62f2cdhumbedooh </highlight>
654734c34540d66c4550b856dd1a278779b34138nd </section>
654734c34540d66c4550b856dd1a278779b34138nd</modulesynopsis>