diff options
author | Vincent Untz <vuntz@novell.com> | 2008-11-20 20:15:57 +0100 |
---|---|---|
committer | Vincent Untz <vuntz@novell.com> | 2008-11-20 20:15:57 +0100 |
commit | ed9ae5b677b55baaed859d3607f044c6089cbcc3 (patch) | |
tree | 578522a313dc948c3f514f3475a24153dbc5f51b | |
parent | 38a8f4b0e11be62ac357163acb106fd90e07cb7e (diff) |
Add new policies for PK, and start using them.
Step 1: serversettings.
-rw-r--r-- | src/cups-pk-helper-mechanism.c | 4 | ||||
-rw-r--r-- | src/org.opensuse.cupspkhelper.mechanism.policy.in | 50 |
2 files changed, 50 insertions, 4 deletions
diff --git a/src/cups-pk-helper-mechanism.c b/src/cups-pk-helper-mechanism.c index 471d80e..d0b0826 100644 --- a/src/cups-pk-helper-mechanism.c +++ b/src/cups-pk-helper-mechanism.c @@ -809,7 +809,7 @@ cph_mechanism_server_get_settings (CphMechanism *mechanism, reset_killtimer (mechanism); - if (!_check_polkit_for_action (mechanism, context, "printeraddremove")) + if (!_check_polkit_for_action (mechanism, context, "serversettings")) return FALSE; settings = cph_cups_server_get_settings (mechanism->priv->cups); @@ -828,7 +828,7 @@ cph_mechanism_server_set_settings (CphMechanism *mechanism, reset_killtimer (mechanism); - if (!_check_polkit_for_action (mechanism, context, "printeraddremove")) + if (!_check_polkit_for_action (mechanism, context, "serversettings")) return FALSE; ret = cph_cups_server_set_settings (mechanism->priv->cups, settings); diff --git a/src/org.opensuse.cupspkhelper.mechanism.policy.in b/src/org.opensuse.cupspkhelper.mechanism.policy.in index a316e15..0c3c876 100644 --- a/src/org.opensuse.cupspkhelper.mechanism.policy.in +++ b/src/org.opensuse.cupspkhelper.mechanism.policy.in @@ -8,9 +8,55 @@ <vendor_url>http://www.opensuse.org/</vendor_url> <icon_name>printer</icon_name> + <action id="org.opensuse.cupspkhelper.mechanism.printerdefault"> + <_description>Set a printer as default printer</_description> + <_message>Privileges are required to set a printer, or a class, as default printer.</_message> + <defaults> + <allow_inactive>no</allow_inactive> + <allow_active>auth_admin</allow_active> + </defaults> + </action> + + <action id="org.opensuse.cupspkhelper.mechanism.printerenable"> + <_description>Enable/Disable a printer</_description> + <_message>Privileges are required to enable/disable a printer, or a class.</_message> + <defaults> + <allow_inactive>no</allow_inactive> + <allow_active>auth_admin</allow_active> + </defaults> + </action> + + <action id="org.opensuse.cupspkhelper.mechanism.printerlocal"> + <_description>Add/Remove/Edit a local printer</_description> + <_message>Privileges are required to add/remove/edit a local printer, or a class.</_message> + <defaults> + <allow_inactive>no</allow_inactive> + <allow_active>auth_admin</allow_active> + </defaults> + </action> + + <action id="org.opensuse.cupspkhelper.mechanism.printerremote"> + <_description>Add/Remove/Edit a remote printer</_description> + <_message>Privileges are required to add/remove/edit a remote printer.</_message> + <defaults> + <allow_inactive>no</allow_inactive> + <allow_active>auth_admin</allow_active> + </defaults> + </action> + + <action id="org.opensuse.cupspkhelper.mechanism.serversettings"> + <_description>Get/Set server settings</_description> + <_message>Privileges are required to get/set server settings.</_message> + <defaults> + <allow_inactive>no</allow_inactive> + <allow_active>auth_admin</allow_active> + </defaults> + </action> + + <!-- Deprecated --> <action id="org.opensuse.cupspkhelper.mechanism.printeraddremove"> - <_description>Add/Remove a printer</_description> - <_message>Privileges are required to add/remove a printer.</_message> + <_description>Add/Remove/Edit a printer</_description> + <_message>Privileges are required to add/remove/edit a printer.</_message> <defaults> <allow_inactive>no</allow_inactive> <allow_active>auth_admin</allow_active> |