Author: jreidinger
Date: Tue Jun 23 14:28:19 2009
New Revision: 57701
URL: http://svn.opensuse.org/viewcvs/yast?rev=57701&view=rev
Log:
add policy files for YaPI and update YaPI for time
Added:
trunk/country/package/org.opensuse.yast.modules.yapi.language.policy
trunk/country/package/org.opensuse.yast.modules.yapi.time.policy
Modified:
trunk/country/timezone/src/YaPI/TIME.pm
trunk/country/yast2-country.spec.in
Added: trunk/country/package/org.opensuse.yast.modules.yapi.language.policy
URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/package/org.opensuse.yast.modules.yapi.language.policy?rev=57701&view=auto
==============================================================================
--- trunk/country/package/org.opensuse.yast.modules.yapi.language.policy (added)
+++ trunk/country/package/org.opensuse.yast.modules.yapi.language.policy Tue Jun 23 14:28:19 2009
@@ -0,0 +1,31 @@
+<?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>YaST Webservice Project</vendor>
+ http://en.opensuse.org/YAST
+
+<!--
+Rights for languages
+-->
+
+ <action id="org.opensuse.yast.modules.yapi.language.read">
+ <description>Reading languages settings</description>
+ <message>Authentication is required to read languages settings</message>
+ <defaults>
+ no
+ no
+ </defaults>
+ </action>
+ <action id="org.opensuse.yast.modules.yapi.language.write">
+ <description>Writing new language settings</description>
+ <message>Authentication is required to edit language settings</message>
+ <defaults>
+ no
+ no
+ </defaults>
+ </action>
+
+</policyconfig>
\ No newline at end of file
Added: trunk/country/package/org.opensuse.yast.modules.yapi.time.policy
URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/package/org.opensuse.yast.modules.yapi.time.policy?rev=57701&view=auto
==============================================================================
--- trunk/country/package/org.opensuse.yast.modules.yapi.time.policy (added)
+++ trunk/country/package/org.opensuse.yast.modules.yapi.time.policy Tue Jun 23 14:28:19 2009
@@ -0,0 +1,31 @@
+<?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>YaST Webservice Project</vendor>
+ http://en.opensuse.org/YAST
+
+<!--
+Rights for system.time
+-->
+
+ <action id="org.opensuse.yast.modules.yapi.time.read">
+ <description>Reading system time settings</description>
+ <message>Authentication is required to read system time settings</message>
+ <defaults>
+ no
+ no
+ </defaults>
+ </action>
+ <action id="org.opensuse.yast.modules.yapi.time.write">
+ <description>Writing system time settings</description>
+ <message>Authentication is required to read system time settings</message>
+ <defaults>
+ no
+ no
+ </defaults>
+ </action>
+
+</policyconfig>
Modified: trunk/country/timezone/src/YaPI/TIME.pm
URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/timezone/src/YaPI/TIME.pm?rev=57701&r1=57700&r2=57701&view=diff
==============================================================================
--- trunk/country/timezone/src/YaPI/TIME.pm (original)
+++ trunk/country/timezone/src/YaPI/TIME.pm Tue Jun 23 14:28:19 2009
@@ -44,4 +44,27 @@
return $ret;
}
+BEGIN{$TYPEINFO{Write} = ["function",
+ ["boolean"],["map","string","string"]];
+}
+sub Read {
+ my $self = shift;
+ my $args = shift;
+ Timezone->Read();
+ if (defined $args->{"utcstatus"}){
+ if (Timezone->utc_only()){
+ #do nothink as utc cannot be change
+ } elsif ($args->{"utcstatus"} eq "UTC") {
+ Timezone->hwclock = "-u";
+ } else {
+ Timezone->hwclock = "--localtime";
+ }
+ }
+ if (defined $args->{"timezone"}){
+ Timezone->Set($args->{"timezone"},YaST::YCP::Boolean(1));
+ }
+ Timezone->Save();
+ return 1;
+}
+
1;
Modified: trunk/country/yast2-country.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/country/yast2-country.spec.in?rev=57701&r1=57700&r2=57701&view=diff
==============================================================================
--- trunk/country/yast2-country.spec.in (original)
+++ trunk/country/yast2-country.spec.in Tue Jun 23 14:28:19 2009
@@ -3,6 +3,9 @@
@HEADER@
Group: System/YaST
License: GPL v2 or later
+#policy files for YaPI dbus interface
+Source1: org.opensuse.yast.modules.yapi.time.policy
+Source2: org.opensuse.yast.modules.yapi.language.policy
BuildRequires: perl-XML-Writer update-desktop-files yast2-devtools yast2-testsuite yast2 yast2-perl-bindings
Requires: yast2-trans-stats yast2-perl-bindings timezone
# XVersion.ycp
@@ -59,6 +62,11 @@
rm -f $RPM_BUILD_ROOT@desktopdir@/keyboard.desktop
%endif
+# Policies
+mkdir -p $RPM_BUILD_ROOT/usr/share/PolicyKit/policy
+install -m 0644 %SOURCE1 $RPM_BUILD_ROOT/usr/share/PolicyKit/policy/
+install -m 0644 %SOURCE2 $RPM_BUILD_ROOT/usr/share/PolicyKit/policy/
+
@CLEAN@
# common
@@ -97,3 +105,4 @@
%dir @ydatadir@/languages
@ydatadir@/languages/*.ycp
@moduledir@/Language.y*
+%attr(644,root,root) %config /usr/share/PolicyKit/policy/org.opensuse.yast.modules.yapi.*.policy
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org