1 /*
2  * Copyright (c) 2023-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef POLICY_INFO_H
17 #define POLICY_INFO_H
18 
19 #include <cstdint>
20 #include <string>
21 
22 namespace OHOS {
23 namespace AccessControl {
24 namespace SandboxManager {
25 struct PolicyInfo final {
26 public:
27     std::string path;
28     uint64_t mode;
29 };
30 
31 typedef enum SandboxRetType {
32     OPERATE_SUCCESSFULLY = 0,
33     FORBIDDEN_TO_BE_PERSISTED = 1,
34     INVALID_MODE = 2,
35     INVALID_PATH = 3,
36     POLICY_HAS_NOT_BEEN_PERSISTED = 4,
37     POLICY_MAC_FAIL = 5,
38 } SandboxRetType;
39 
40 const uint32_t IS_POLICY_ALLOWED_TO_BE_PRESISTED = 1 << 0;
41 
42 typedef enum OperateMode {
43     READ_MODE = 1 << 0,
44     WRITE_MODE = 1 << 1,
45 } OperateMode;
46 } // namespace SandboxManager
47 } // namespace AccessControl
48 } // namespace OHOS
49 #endif // POLICY_INFO_H