Migrate existing application policy to use new ask-user policies 85/122485/3
authorRafal Krypa <r.krypa@samsung.com>
Fri, 31 Mar 2017 15:40:38 +0000 (17:40 +0200)
committerTomasz Swierczek <t.swierczek@samsung.com>
Sun, 2 Apr 2017 12:33:02 +0000 (14:33 +0200)
Migrate privacy manager policy:
- ask user => ASK_USER_LEGACY
- deny => PRIVACY_DENY

Change-Id: Icfeea3324c8d823d8a0065198b9a8c9329528be8
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
policy/updates/update-policy-to-v6.sh [new file with mode: 0755]

diff --git a/policy/updates/update-policy-to-v6.sh b/policy/updates/update-policy-to-v6.sh
new file mode 100755 (executable)
index 0000000..fbe98b8
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh -e
+
+export PATH=/sbin:/usr/sbin:/bin:/usr/bin
+
+. /etc/tizen-platform.conf
+
+systemctl restart cynara.service
+systemctl stop security-manager.service security-manager.socket
+cyad --list-policies="" --all --human-readable |
+while IFS=';' read bucket client user privilege policy metadata
+do
+       [ "$policy" = "ask user" ] && cyad --set-policy --client="$client" --user="$user" --privilege="$privilege" --type="ASK_USER_LEGACY"
+       [ "$policy" = "deny" ]     && cyad --set-policy --client="$client" --user="$user" --privilege="$privilege" --type="PRIVACY_DENY"
+done
+
+systemctl start security-manager.service security-manager.socket