summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2012-05-21 13:54:35 -0400
committerDavid Zeuthen <davidz@redhat.com>2012-05-21 13:54:35 -0400
commit5b393dfb9d193a997303b7682d10f479a5e327ec (patch)
tree8dd2f2ecd606faeb40d6c2befa047c8f81914c07
parent31c0ce425a03c59726b7c1a83aaf8cd8dfab79f7 (diff)
downloadpolkit-5b393dfb9d193a997303b7682d10f479a5e327ec.tar.gz
Minor doc fixes
Nuke the has_prefix() helper, it's just confusing. Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r--docs/man/polkit.xml11
1 files changed, 4 insertions, 7 deletions
diff --git a/docs/man/polkit.xml b/docs/man/polkit.xml
index ee658c5..57dd366 100644
--- a/docs/man/polkit.xml
+++ b/docs/man/polkit.xml
@@ -717,16 +717,13 @@ polkit.addAdminRule(function(action, subject, details) {
<para>
Forbid users in group <literal>children</literal> to change
- hostname configuration and allow anyone else to do it (after
- authenticating as themselves):
+ hostname configuration (that is, any action starting wth
+ <literal>org.freedesktop.hostname1.</literal>) and allow
+ anyone else to do it after authenticating as themselves:
</para>
<programlisting><![CDATA[
-function has_prefix(str, prefix) {
- return str.indexOf(prefix) == 0;
-}
-
polkit.addRule(function(action, subject, details) {
- if (has_prefix(action, "org.freedesktop.hostname1.")) {
+ if (action.indexOf("org.freedesktop.hostname1.") == 0) {
if (subject.isInGroup("children")) {
return "no";
} else {