# Target - sources
SET(SRCS
+ privileges.cc
app_installer.cc
backup_paths.cc
certificate_validation.cc
--- /dev/null
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a apache 2.0 license that can be
+// found in the LICENSE file.
+
+#include "common/privileges.h"
+
+namespace common {
+namespace privileges {
+const char kImePrivilegeName[] = "http://tizen.org/privilege/ime";
+const char kPrivForWebApp[] =
+ "http://tizen.org/privilege/internal/webappdefault";
+const char kPrivForPublic[] =
+ "http://tizen.org/privilege/internal/default/public";
+const char kPrivForPartner[] =
+ "http://tizen.org/privilege/internal/default/partner";
+const char kPrivForPlatform[] =
+ "http://tizen.org/privilege/internal/default/platform";
+const char kPrivForExternalAppData[] =
+ "http://tizen.org/privilege/externalstorage.appdata";
+} // namespace privileges
+} // namespace common
--- /dev/null
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by a apache 2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef COMMON_PRIVILEGES_H_
+#define COMMON_PRIVILEGES_H_
+
+namespace common {
+namespace privileges {
+extern const char kImePrivilegeName[];
+extern const char kPrivForWebApp[];
+extern const char kPrivForPublic[];
+extern const char kPrivForPartner[];
+extern const char kPrivForPlatform[];
+extern const char kPrivForExternalAppData[];
+} // namespace privileges
+} // namespace common
+
+#endif // COMMON_PRIVILEGES_H_
#include <vector>
#include "common/step/filesystem/step_create_per_user_storage_directories.h"
+#include "common/privileges.h"
#include "common/shared_dirs.h"
#include "common/utils/glist_range.h"
bool StepCreatePerUserStorageDirectories::CreateExternalStorageDir() {
auto manifest = context_->manifest_data.get();
bool has_external_storage_priv = false;
- const char* privilege =
- "http://tizen.org/privilege/externalstorage.appdata";
for (const char* priv : GListRange<char*>(manifest->privileges)) {
- if (strcmp(priv, privilege) == 0) {
+ if (strcmp(priv, common::privileges::kPrivForExternalAppData) == 0) {
has_external_storage_priv = true;
LOG(DEBUG) << "External storage privilege has been found.";
break;
#include <memory>
#include <string>
+#include "common/privileges.h"
#include "common/utils/glist_range.h"
namespace {
-const char kPrivForPublic[] =
- "http://tizen.org/privilege/internal/default/public";
-const char kPrivForPartner[] =
- "http://tizen.org/privilege/internal/default/partner";
-const char kPrivForPlatform[] =
- "http://tizen.org/privilege/internal/default/platform";
-
bool TranslatePrivilegesForCompatibility(manifest_x* m) {
if (!m->api_version) {
LOG(WARNING) << "Skipping privileges mapping because api-version "
case common_installer::PrivilegeLevel::PUBLIC:
context_->manifest_data.get()->privileges =
g_list_append(context_->manifest_data.get()->privileges,
- strdup(kPrivForPublic));
+ strdup(common::privileges::kPrivForPublic));
break;
case common_installer::PrivilegeLevel::PARTNER:
context_->manifest_data.get()->privileges =
g_list_append(context_->manifest_data.get()->privileges,
- strdup(kPrivForPartner));
+ strdup(common::privileges::kPrivForPartner));
break;
case common_installer::PrivilegeLevel::PLATFORM:
context_->manifest_data.get()->privileges =
g_list_append(context_->manifest_data.get()->privileges,
- strdup(kPrivForPlatform));
+ strdup(common::privileges::kPrivForPlatform));
break;
default:
// TODO(jongmyeong.ko): temporarily, public privileges for untrusted
// application.
context_->manifest_data.get()->privileges =
g_list_append(context_->manifest_data.get()->privileges,
- strdup(kPrivForPublic));
+ strdup(common::privileges::kPrivForPublic));
break;
}
if (!ret) {