2022-08-19 22:20:43 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <Kernel/FileSystem/InodeMetadata.h>
|
|
|
|
#include <Kernel/Process.h>
|
|
|
|
|
|
|
|
namespace Kernel {
|
|
|
|
|
2022-08-21 16:02:24 +02:00
|
|
|
bool InodeMetadata::may_read(Credentials const& credentials) const
|
2022-08-19 22:20:43 +02:00
|
|
|
{
|
2022-08-21 16:02:24 +02:00
|
|
|
return may_read(credentials.euid(), credentials.egid(), credentials.extra_gids());
|
2022-08-19 22:20:43 +02:00
|
|
|
}
|
|
|
|
|
2022-08-21 16:02:24 +02:00
|
|
|
bool InodeMetadata::may_write(Credentials const& credentials) const
|
2022-08-19 22:20:43 +02:00
|
|
|
{
|
2022-08-21 16:02:24 +02:00
|
|
|
return may_write(credentials.euid(), credentials.egid(), credentials.extra_gids());
|
2022-08-19 22:20:43 +02:00
|
|
|
}
|
|
|
|
|
2022-08-21 16:02:24 +02:00
|
|
|
bool InodeMetadata::may_execute(Credentials const& credentials) const
|
2022-08-19 22:20:43 +02:00
|
|
|
{
|
2022-08-21 16:02:24 +02:00
|
|
|
return may_execute(credentials.euid(), credentials.egid(), credentials.extra_gids());
|
2022-08-19 22:20:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|