diff options
| author | Amlal <amlal@zka.com> | 2024-07-23 12:02:10 +0200 |
|---|---|---|
| committer | Amlal <amlal@zka.com> | 2024-07-23 12:02:10 +0200 |
| commit | 274cba18b8f1c255ddcff2f5c14aab4d0c846820 (patch) | |
| tree | aa56d2223c79d447b85a2bfefdbaab90b25fc8fe /Kernel/KernelKit/User.hxx | |
| parent | 8eee31685e4334415870bb00b11b6b0d29821f10 (diff) | |
[IMP] User class and current user global.
[REMOVE] ApplicationInterface struct.
[IMP] DDK_STATUS_STRUCT data structure for driver events.
Signed-off-by: Amlal <amlal@zka.com>
Diffstat (limited to 'Kernel/KernelKit/User.hxx')
| -rw-r--r-- | Kernel/KernelKit/User.hxx | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Kernel/KernelKit/User.hxx b/Kernel/KernelKit/User.hxx new file mode 100644 index 00000000..aa0901ac --- /dev/null +++ b/Kernel/KernelKit/User.hxx @@ -0,0 +1,65 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies + +------------------------------------------- */ + +#ifndef _INC_PERMISSION_SEL_HXX_ +#define _INC_PERMISSION_SEL_HXX_ + +#include <CompilerKit/CompilerKit.hxx> +#include <NewKit/String.hpp> +#include <NewKit/Defines.hpp> + +// user mode users. +#define kSuperUser "Admin" +#define kGuestUser "Guest" + +#define kUsersDir "\\Users\\Store\\" + +#define kMaxUserNameLen (255) + +// hash 'password' -> base64+md5 encoded data +// use this data to then fetch specific data of the user.. + +namespace Kernel +{ + enum class RingKind + { + kRingStdUser = 1, + kRingSuperUser = 2, + kRingGuestUser = 5, + kRingCount = 5, + }; + + class User final + { + public: + explicit User() = default; + + User(const Int32& sel, const Char* userName); + User(const RingKind& kind, const Char* userName); + + ~User(); + + public: + NEWOS_COPY_DEFAULT(User) + + public: + bool operator==(const User& lhs); + bool operator!=(const User& lhs); + + public: + const RingKind& Ring() noexcept; + const StringView Name() noexcept; + + private: + RingKind fRing{RingKind::kRingStdUser}; + StringView fUserName{kMaxUserNameLen}; + + }; + + inline User* cRootUser = nullptr; +} // namespace Kernel + +#endif /* ifndef _INC_PERMISSION_SEL_HXX_ */ |
