summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-03-24 12:30:56 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-03-24 12:30:56 +0100
commitefdde41a4421fc44027f4b12d84adcb13adf11e0 (patch)
treed9958420b61acfccb90cdf8642b3b58746ed24c2 /src
parent0c43e344918569474e1460876105c9f1eb43efa8 (diff)
[FEAT] Add User AgeAuth API.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src')
-rw-r--r--src/kernel/KernelKit/User.h5
-rw-r--r--src/kernel/src/User.cpp2
-rw-r--r--src/libSystem/SystemKit/System.h6
3 files changed, 13 insertions, 0 deletions
diff --git a/src/kernel/KernelKit/User.h b/src/kernel/KernelKit/User.h
index 6711bce7..cc64bd1c 100644
--- a/src/kernel/KernelKit/User.h
+++ b/src/kernel/KernelKit/User.h
@@ -82,10 +82,15 @@ class User final {
/// @param password the password to check.
Bool Login(const UserPublicKey password);
+ /// @brief Returns whether the user is an adult or not.
+ Bool IsAdult();
+
private:
UserRingKind mUserRing{UserRingKind::kRingStdUser};
Char mUserName[kMaxUserNameLen] = {0};
UInt64 mUserFNV{0UL};
+ Bool mUserIsAdult{NO};
+
};
/// \brief Alias for user ptr.
diff --git a/src/kernel/src/User.cpp b/src/kernel/src/User.cpp
index daaf27a4..6fd2e7b3 100644
--- a/src/kernel/src/User.cpp
+++ b/src/kernel/src/User.cpp
@@ -66,6 +66,8 @@ User::User(const UserRingKind& ring_kind, const UserPublicKeyType* user_name)
////////////////////////////////////////////////////////////
User::~User() = default;
+Bool User::IsAdult() { return mUserIsAdult; }
+
Bool User::Save(const UserPublicKey password) {
if (!password || *password == 0) return No;
diff --git a/src/libSystem/SystemKit/System.h b/src/libSystem/SystemKit/System.h
index 324aae5c..7e4a9ae6 100644
--- a/src/libSystem/SystemKit/System.h
+++ b/src/libSystem/SystemKit/System.h
@@ -408,4 +408,10 @@ IMPORT_C SInt32 SemWait(_Input SemaphoreRef sem);
/// @brief Close a semaphore.
IMPORT_C SInt32 SemClose(_Input SemaphoreRef sem);
+// ------------------------------------------------------------------------------------------ //
+// @brief User AgeAuth API.
+// ------------------------------------------------------------------------------------------ //
+
+IMPORT_C SInt32 UserIsAdult(_Input SInt32 uid);
+
#endif // ifndef SYSTEMKIT_SYSTEM_H