mirror of
https://gitee.com/openharmony/account_os_account
synced 2024-11-23 02:00:01 +00:00
!2266 toberemove 添加id限制
Merge pull request !2266 from xuqian0131/ToBeRemove
This commit is contained in:
commit
c5b2058ed3
@ -1155,6 +1155,14 @@ ErrCode OsAccountManagerService::GetBackgroundOsAccountLocalIds(std::vector<int3
|
||||
|
||||
ErrCode OsAccountManagerService::SetOsAccountToBeRemoved(int32_t localId, bool toBeRemoved)
|
||||
{
|
||||
ErrCode res = CheckLocalId(localId);
|
||||
if (res != ERR_OK) {
|
||||
return res;
|
||||
}
|
||||
if ((localId == Constants::START_USER_ID) || (localId == Constants::ADMIN_LOCAL_ID)) {
|
||||
ACCOUNT_LOGE("Cannot remove system preinstalled user.");
|
||||
return ERR_OSACCOUNT_SERVICE_MANAGER_ID_ERROR;
|
||||
}
|
||||
if (!PermissionCheck(MANAGE_LOCAL_ACCOUNTS, "")) {
|
||||
ACCOUNT_LOGE("Permission denied.");
|
||||
return ERR_ACCOUNT_COMMON_PERMISSION_DENIED;
|
||||
|
Loading…
Reference in New Issue
Block a user