[gnome-control-center] user-accounts: Combine realmd permissions into panel unlock



commit a70e50f268cd70c3f504d0ec6cbc905a4af34931
Author: Stef Walter <stefw gnome org>
Date:   Thu Jun 14 14:22:18 2012 +0200

    user-accounts: Combine realmd permissions into panel unlock
    
    Create a new policy file for the admin actions of the user
    accounts panel, combining the relevant actions of
    accountsservice and realmd.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678098

 panels/user-accounts/Makefile.am                   |   11 ++++++++++
 ...org.gnome.controlcenter.user-accounts.policy.in |   21 ++++++++++++++++++++
 panels/user-accounts/um-user-panel.c               |    2 +-
 3 files changed, 33 insertions(+), 1 deletions(-)
---
diff --git a/panels/user-accounts/Makefile.am b/panels/user-accounts/Makefile.am
index 8a7da5d..13e86f9 100644
--- a/panels/user-accounts/Makefile.am
+++ b/panels/user-accounts/Makefile.am
@@ -104,8 +104,19 @@ frob_account_dialog_CFLAGS = \
 	$(AM_CFLAGS) \
 	-DUIDIR=\""$(pkgdatadir)/ui/user-accounts"\"
 
+polkitdir = $(datadir)/polkit-1/actions
+polkit_in_files = org.gnome.controlcenter.user-accounts.policy.in
+
+ INTLTOOL_POLICY_RULE@
+polkit_DATA = $(polkit_in_files:.policy.in=.policy)
+
+EXTRA_DIST =				\
+	$(polkit_in_files)		\
+	$(NULL)
+
 CLEANFILES =				\
 	$(BUILT_SOURCES)		\
+	$(polkit_DATA)			\
 	$(NULL)
 
 MAINTAINERCLEANFILES =                  \
diff --git a/panels/user-accounts/org.gnome.controlcenter.user-accounts.policy.in b/panels/user-accounts/org.gnome.controlcenter.user-accounts.policy.in
new file mode 100644
index 0000000..46a4f2f
--- /dev/null
+++ b/panels/user-accounts/org.gnome.controlcenter.user-accounts.policy.in
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC
+ "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd";>
+
+<policyconfig>
+  <vendor>The GNOME Project</vendor>
+  <vendor_url>http://www.gnome.org/</vendor_url>
+
+  <action id="org.gnome.controlcenter.user-accounts.administration">
+    <_description>Manage user accounts</_description>
+    <_message>Authentication is required to change user data</_message>
+    <defaults>
+      <allow_any>no</allow_any>
+      <allow_inactive>no</allow_inactive>
+      <allow_active>auth_admin_keep</allow_active>
+    </defaults>
+    <annotate key="org.freedesktop.policykit.imply">org.freedesktop.accounts.user-administration org.freedesktop.realmd.enroll-machine org.freedesktop.realmd.login-policy</annotate>
+  </action>
+
+</policyconfig>
diff --git a/panels/user-accounts/um-user-panel.c b/panels/user-accounts/um-user-panel.c
index 65e132a..3612608 100644
--- a/panels/user-accounts/um-user-panel.c
+++ b/panels/user-accounts/um-user-panel.c
@@ -1223,7 +1223,7 @@ setup_main_window (UmUserPanelPrivate *d)
         g_signal_connect (button, "clicked",
                           G_CALLBACK (change_fingerprint), d);
 
-        d->permission = (GPermission *)polkit_permission_new_sync ("org.freedesktop.accounts.user-administration", NULL, NULL, NULL);
+        d->permission = (GPermission *)polkit_permission_new_sync ("org.gnome.controlcenter.user-accounts.administration", NULL, NULL, NULL);
         g_signal_connect (d->permission, "notify",
                           G_CALLBACK (on_permission_changed), d);
         on_permission_changed (d->permission, NULL, d);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]