1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
5 #include "wgt/step/security/step_add_default_privileges.h"
6 #include <common/privileges.h>
8 #include <pkgmgrinfo_basic.h>
17 common_installer::Step::Status StepAddDefaultPrivileges::precheck() {
18 if (!context_->manifest_data.get()) {
19 LOG(ERROR) << "Manifest data is not set";
25 common_installer::Step::Status StepAddDefaultPrivileges::process() {
26 manifest_x* m = context_->manifest_data.get();
27 privilege_x* privilege =
28 reinterpret_cast<privilege_x*>(calloc(1, sizeof(privilege_x)));
29 privilege->type = strdup(common_installer::kWebPrivilegeType);
30 privilege->value = strdup(common_installer::privileges::kPrivForWebApp);
31 m->privileges = g_list_append(m->privileges, privilege);
35 } // namespace security