Add privilege names 98/231898/3
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 24 Apr 2020 13:11:31 +0000 (15:11 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 28 Apr 2020 11:41:15 +0000 (13:41 +0200)
Also add new Privilege ctor to work with char* privilege names.

Change-Id: I8dd79e095bf118eb2f83b94182944a9eef0cfb11

src/common/app_def_privilege.h
src/security-manager-tests/common/privilege_names.h [new file with mode: 0644]

index d399dac..a39b7ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2018 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014-2020 Samsung Electronics Co., Ltd All Rights Reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
@@ -32,6 +32,12 @@ public:
         PRIVACY,
     };
 
+    Privilege(const char* systemPrivilege, Type type = UNSET, std::string license = std::string())
+      : m_name(systemPrivilege)
+      , m_type(type)
+      , m_license(std::move(license))
+    {}
+
     Privilege(std::string systemPrivilege, Type type = UNSET, std::string license = std::string())
       : m_name(std::move(systemPrivilege))
       , m_type(type)
diff --git a/src/security-manager-tests/common/privilege_names.h b/src/security-manager-tests/common/privilege_names.h
new file mode 100644 (file)
index 0000000..2c6e418
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#pragma once
+
+namespace PrivilegeNames {
+
+constexpr char PRIV_INTERNAL_AUDIO[] = "http://tizen.org/privilege/internal/device/audio";
+constexpr char PRIV_INTERNAL_DISPLAY[] = "http://tizen.org/privilege/internal/device/display";
+constexpr char PRIV_INTERNAL_USERMANAGEMENT[] = "http://tizen.org/privilege/internal/usermanagement";
+constexpr char PRIV_INTERNAL_VIDEO[] = "http://tizen.org/privilege/internal/device/video";
+
+constexpr char PRIV_ACCOUNT_READ[] = "http://tizen.org/privilege/account.read";
+constexpr char PRIV_BLUETOOTH[] = "http://tizen.org/privilege/bluetooth";
+constexpr char PRIV_CALENDAR_READ[] = "http://tizen.org/privilege/calendar.read";
+constexpr char PRIV_CALENDAR_WRITE[] = "http://tizen.org/privilege/calendar.write";
+constexpr char PRIV_CALLHISTORY_READ[] = "http://tizen.org/privilege/callhistory.read";
+constexpr char PRIV_CAMERA[] = "http://tizen.org/privilege/camera";
+constexpr char PRIV_CONTACTS_READ[] = "http://tizen.org/privilege/contacts.read";
+constexpr char PRIV_CONTENT_WRITE[] = "http://tizen.org/privilege/content.write";
+constexpr char PRIV_DATASHARING[] = "http://tizen.org/privilege/datasharing";
+constexpr char PRIV_DISPLAY[] = "http://tizen.org/privilege/display";
+constexpr char PRIV_EMAIL[] = "http://tizen.org/privilege/email";
+constexpr char PRIV_EXTERNALSTORAGE[] = "http://tizen.org/privilege/externalstorage";
+constexpr char PRIV_HEALTHINFO[] = "http://tizen.org/privilege/healthinfo";
+constexpr char PRIV_INTERNET[] = "http://tizen.org/privilege/internet";
+constexpr char PRIV_LED[] = "http://tizen.org/privilege/led";
+constexpr char PRIV_LOCATION[] = "http://tizen.org/privilege/location";
+constexpr char PRIV_MEDIASTORAGE[] = "http://tizen.org/privilege/mediastorage";
+constexpr char PRIV_NFC[] = "http://tizen.org/privilege/nfc";
+constexpr char PRIV_NOTEXIST[] = "http://tizen.org/privilege/notexist";
+constexpr char PRIV_NOTIFICATION[] = "http://tizen.org/privilege/notification";
+constexpr char PRIV_POWER[] = "http://tizen.org/privilege/power";
+constexpr char PRIV_PUSH[] = "http://tizen.org/privilege/push";
+constexpr char PRIV_SYSTEMMONITOR[] = "http://tizen.org/privilege/systemmonitor";
+constexpr char PRIV_TELEPHONY[] = "http://tizen.org/privilege/telephony";
+constexpr char PRIV_VOLUME_SET[] = "http://tizen.org/privilege/volume.set";
+constexpr char PRIV_VPNSERVICE[] = "http://tizen.org/privilege/vpnservice";
+constexpr char PRIV_WIFIDIRECT[] = "http://tizen.org/privilege/wifidirect";
+
+}