<form class="compose" method="post">
	<img src="/avi/@handle">
	<textarea autofocus name="post" placeholder="it was a dark and stormy night…">@content</textarea>
	<input required type="text" name="acl" class="acl" value="@acl">
		<a href="#aclhelp" class="help">?</a>
	<button type="submit">commit</button>
</form>

<div id="aclhelp" class="modal"> <a href="#0">close</a> <div>
	<p>to control who can see your post (and how far it is propagated), <code>parsav</code> uses <strong>ACL expressions</strong>. this is roughly equivalent to scoping in pleroma or GNU social terms. an ACL expression consists of one or more space-separated terms, each of which match a certain set of users. a term can be negated by prefixing it with <code>~</code>, a tilde character, so <code>~all</code> matches nobody, and <code>~followed</code> matches users you do not follow.</p>
	<ul>
		<li><strong>all</strong>: matches any and all users</li>
		<li><strong>local</strong>: matches users who belong to this instance</li>
		<li><strong>mutuals</strong>: matches users you follow who also follow you</li>
		<li><strong>followed</strong>: matches users you follow</li>
		<li><strong>followers</strong>: matches users who follow you</li>
		<li><strong>groupies</strong>: matches users who follow you, but whom you do not follow</li>
		<li><strong>mentioned</strong>: matches users who are mentioned in the post</li>
		<li><strong>staff</strong>: matches instance staff (equivalent to <code>~%0</code>)</li>
		<li><strong>admin</strong>: matches the individual named as the instance administrator, if any</li>
		<li><strong>\@</strong><em>handle</em>: matches the user <em>handle</em></li>
		<li><strong>+</strong><em>circle</em>: matches users you have categorized under <em>circle</em></li>
		<li><strong>#</strong><em>room</em>: matches users who are members of <em>room</em></li>
		<li><strong>%</strong><em>rank</em>: matches users of <em>rank</em> or higher (e.g. <code>%3</code> matches users of rank 3, 2, and 1). as a special case, <code>%0</code> matches ordinary users</li>
		<li><strong>#</strong><em>room</em><strong>%</strong><em>rank</em>: matches users who hold <em>rank</em> in <em>room</em></li>
		<li><strong>&lt;</strong><em>title</em><strong>&gt;</strong>: matches peers of the net who have been created <em>title</em> by the sovereign</li>
		<li><strong>#</strong><em>room</em><strong>&lt;</strong><em>title</em><strong>&gt;</strong>: matches peers of the chat who have been created <em>title</em> by <em>room</em> staff</li>
	</ul>
	<p>to evaluate an ACL expression, <code>parsav</code> reads each term from start to finish. for each term, it considers whether it describes the user who is attempting to access the content. if the term matches, its policy is applied and the expression completes. if the term doesn't match, the server proceeds on to the next term and the process repeats until it finds a matching term or runs out of terms, applying the fallback policy.</p>
	<p><strong>policy</strong> is whether a term grants or denies access. the default term policy is <strong>allow</strong>, but you can control the policy with the keywords <code>allow</code> and <code>deny</code>. if a term finishes evaluating without any match being found, a fallback policy is applied; this fallback is the opposite of whatever the current policy is. this sounds confusing but makes ACL expressions much more intuitive; <code>allow \@bob</code> and <code>deny trent</code> do exactly what you'd expect &em; the former allows bob and only bob in; the latter denies access only to trent, but grants access to the rest of the world.</p>
	<p>expressions must contain at least one term to be valid. if they consist only of policy keywords, they will be rejected.</p>
	<p>in effect, this all means that an ACL expression can be treated as a simple list of who is allowed to view your post. for instance, an expression of <code>local</code> means only local users can view it. however, much more complex expressions are possible.</p>
	<ul>
		<li><code>deny groupies allow +illuminati</code>: permits access to the illuminati, but excluding those members who are groupies</li>
		<li><code>+illuminati deny groupies</code>: allows access to everyone but groupies (unless they're in the illuminati)</li>
		<li><code>\@eve \@alice\@nowhere.tld deny \@bob \@trent\@witches.live</code>: grants access to eve and alice, but locks out bob and trent</li>
		<li><code>&lt;grand duke&gt; #4th-intl&lt;comrade&gt;</code>: restricts the post to the eyes of the Fourth International's secret cabal of anointed comrades and the grand dukes of the Empire</li>
		<li><code>deny ~%3</code>: blocks a post from being seen by anyone with a staff rank level below 3</li>
	</ul>
	<p><strong>limitations:</strong> to inhibit potential denial-of-service attacks, ACL expressions can be a maximum of 128 characters, can contain at most 16 words, and cannot trigger queries against other servers. all information needed to evaluate an ACL expression must be known locally. this is particularly relevant with respect to rooms.</p>
</div></div>
