• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 SERVICES_EDM_INCLUDE_ADMIN_H
17 #define SERVICES_EDM_INCLUDE_ADMIN_H
18 
19 #include <string>
20 #include <vector>
21 
22 #include "ability_info.h"
23 #include "admin_type.h"
24 #include "edm_errors.h"
25 #include "ent_info.h"
26 #include "managed_event.h"
27 #include "parcel_macro.h"
28 
29 namespace OHOS {
30 namespace EDM {
31 struct AdminInfo {
32     AdminType adminType_;
33     std::string packageName_;
34     std::string className_;
35     EntInfo entInfo_;
36     std::vector<std::string> permission_;
37     std::vector<ManagedEvent> managedEvents_;
38     std::string parentAdminName_;
39 };
40 
41 class Admin {
42 public:
43     virtual bool CheckPermission(const std::string &permission);
44     virtual AdminType GetAdminType();
45     virtual std::string GetParentAdminName() const;
46     virtual ~Admin() = default;
47     AdminInfo adminInfo_;
48 };
49 } // namespace EDM
50 } // namespace OHOS
51 
52 #endif // SERVICES_EDM_INCLUDE_ADMIN_H
53