mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-27 10:50:41 +00:00
fix:Modify token permission calc get system app type
Signed-off-by: wangxin <wangxin617@huawei.com>
This commit is contained in:
parent
d77b7ffeb5
commit
8c6c9cf240
@ -27,6 +27,7 @@
|
||||
#include "softbus_def.h"
|
||||
#include "softbus_errcode.h"
|
||||
#include "system_ability_definition.h"
|
||||
#include "tokenid_kit.h"
|
||||
#include "trans_session_manager.h"
|
||||
|
||||
namespace {
|
||||
@ -67,10 +68,9 @@ static int32_t CalcPermType(pid_t callingUid, pid_t callingPid)
|
||||
if (tokenType == ATokenTypeEnum::TOKEN_NATIVE) {
|
||||
return NATIVE_APP;
|
||||
} else if (tokenType == ATokenTypeEnum::TOKEN_HAP) {
|
||||
HapTokenInfo hapTokenInfo;
|
||||
AccessTokenKit::GetHapTokenInfo(callingToken, hapTokenInfo);
|
||||
if ((hapTokenInfo.apl == ATokenAplEnum::APL_SYSTEM_CORE) ||
|
||||
(hapTokenInfo.apl == ATokenAplEnum::APL_SYSTEM_BASIC)) {
|
||||
uint64_t accessTokenIDEx = OHOS::IPCSkeleton::GetCallingFullTokenID();
|
||||
bool isSystemApp = TokenIdKit::IsSystemAppByFullTokenID(accessTokenIDEx);
|
||||
if (isSystemApp) {
|
||||
return SYSTEM_APP;
|
||||
}
|
||||
}
|
||||
|
@ -283,6 +283,7 @@ if (defined(ohos_lite)) {
|
||||
external_deps += [
|
||||
"access_token:libaccesstoken_sdk",
|
||||
"access_token:libprivacy_sdk",
|
||||
"access_token:libtokenid_sdk",
|
||||
"device_auth:deviceauth_sdk",
|
||||
"hilog:libhilog",
|
||||
"ipc:ipc_core",
|
||||
|
Loading…
Reference in New Issue
Block a user