147 </para> |
147 </para> |
148 <section> |
148 <section> |
149 <title>Using access.conf</title> |
149 <title>Using access.conf</title> |
150 <para> |
150 <para> |
151 mercurial-server offers much more fine-grained access control than this division into two classes of users. Let's suppose you wish to give Pat access to the <literal>widget</literal> repository, but no other. We first copy Pat's SSH public key into the <filename |
151 mercurial-server offers much more fine-grained access control than this division into two classes of users. Let's suppose you wish to give Pat access to the <literal>widget</literal> repository, but no other. We first copy Pat's SSH public key into the <filename |
152 class='directory'>keys/widget/pat</filename> directory in <literal>hgadmin</literal>. Now mercurial-server knows about Pat's key, but will give Pat no access to anything because the key is not under either <filename |
152 class='directory'>keys/pat</filename> directory in <literal>hgadmin</literal>. This tells mercurial-server about Pat's key, but gives Pat no access to anything because the key is not under either <filename |
153 class='directory'>keys/root</filename> or <filename |
153 class='directory'>keys/root</filename> or <filename |
154 class='directory'>keys/users</filename>. To grant this key access, we must give mercurial-server a new access rule, so we create a file in <literal>hgadmin</literal> called <filename>access.conf</filename>, with the following contents:</para> |
154 class='directory'>keys/users</filename>. To grant this key access, we must give mercurial-server a new access rule, so we create a file in <literal>hgadmin</literal> called <filename>access.conf</filename>, with the following contents:</para> |
155 <programlisting>write repo=widget user=widget/** |
155 <programlisting># Give Pat access to the "widget" repository |
156 </programlisting> |
156 write repo=widget user=pat |
157 <para> |
157 </programlisting> |
158 Pat will have read and write access as soon as we add, commit, and push these files. |
158 <para> |
|
159 Pat will have read and write access to the <literal>widget</literal> repository as soon as we add, commit, and push these files. |
159 </para> |
160 </para> |
160 <para> |
161 <para> |
161 Each line of <filename>access.conf</filename> has the following syntax: |
162 Each line of <filename>access.conf</filename> has the following syntax: |
162 </para> |
163 </para> |
163 <programlisting><replaceable>rule</replaceable> <replaceable>condition</replaceable> <replaceable>condition...</replaceable> |
164 <programlisting><replaceable>rule</replaceable> <replaceable>condition</replaceable> <replaceable>condition...</replaceable> |