• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 #ifndef OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_OSACCOUNT_IINNER_OS_ACCOUNT_FILE_OPERATOR_H
16 #define OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_OSACCOUNT_IINNER_OS_ACCOUNT_FILE_OPERATOR_H
17 #include <memory>
18 #include "account_file_operator.h"
19 #include "iaccount_info.h"
20 
21 namespace OHOS {
22 namespace AccountSA {
23 class OsAccountFileOperator {
24 public:
25     OsAccountFileOperator();
26     ~OsAccountFileOperator();
27     void Init();
28     ErrCode GetConstraintsByType(const int type, std::vector<std::string> &constratins);
29     ErrCode GetIsMultiOsAccountEnable(bool &isMultiOsAccountEnable);
30     ErrCode IsConstrarionsInTypeList(const std::vector<std::string> &constrains, bool &isExists);
31     ErrCode IsAllowedCreateAdmin(bool &isAllowedCreateAdmin);
32 private:
33     std::shared_ptr<AccountFileOperator> accountFileOperator_;
34     Json constraintsConfig_;
35     std::vector<std::string> constratinsList_;
36     bool isAlreadyInit_;
37 };
38 }  // namespace AccountSA
39 }  // namespace OHOS
40 #endif /* OS_ACCOUNT_SERVICES_ACCOUNTMGR_INCLUDE_OSACCOUNT_IINNER_OS_ACCOUNT_FILE_OPERATOR_H */