SystemAP客户端新增权限校验

Signed-off-by: liusensen <liusen43@huawei.com>
This commit is contained in:
liusensen 2024-07-22 20:41:25 +08:00
parent 497fdb7730
commit 74fad76295
4 changed files with 5 additions and 4 deletions

View File

@ -18,7 +18,7 @@
namespace OHOS {
namespace Rosen {
bool Permission::IsSystemServiceCalling(bool needPrintLog,bool IsLocalSysCalling)
bool Permission::IsSystemServiceCalling(bool needPrintLog, bool IsLocalSysCalling)
{
return true;
}

View File

@ -22,7 +22,7 @@ namespace OHOS {
namespace Rosen {
class Permission {
public:
static bool IsSystemServiceCalling(bool needPrintLog = true, bool IsLocalSysCalling =false);
static bool IsSystemServiceCalling(bool needPrintLog = true, bool IsLocalSysCalling = false);
static bool IsSystemCalling();
static bool IsLocalSystemCalling();
static bool CheckCallingPermission(const std::string& permission);

View File

@ -22,7 +22,7 @@ namespace OHOS {
namespace Rosen {
class Permission {
public:
static bool IsSystemServiceCalling(bool needPrintLog = true, bool IsLocalSysCalling =false);
static bool IsSystemServiceCalling(bool needPrintLog = true, bool IsLocalSysCalling = false);
static bool IsSystemCalling();
static bool IsLocalSystemCalling();
static bool CheckCallingPermission(const std::string& permission);

View File

@ -70,7 +70,7 @@ bool Permission::IsSystemCalling()
bool Permission::IsLocalSystemCalling()
{
if (IsLocalSystemServiceCalling()) {
if (IsSystemServiceCalling(false, true)) {
return true;
}
auto tokenId = IPCSkeleton::GetSelfTokenID();
@ -102,6 +102,7 @@ bool Permission::IsLocalStartByHdcd()
}
return false;
}
bool Permission::IsStartByHdcd()
{
OHOS::Security::AccessToken::NativeTokenInfo info;