#!/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

Migrate existing application policy to use new ask-user policies
Migrate existing application policy to use new ask-user policies

Migrate privacy manager policy:
- ask user => ASK_USER_LEGACY
- deny => PRIVACY_DENY

Change-Id: Icfeea3324c8d823d8a0065198b9a8c9329528be8
Signed-off-by: Rafal Krypa <875f2afab983118b44e45bad4cf04b04767e9f4a@samsung.com>
