The Pedigree Project 0.1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
UserManager Class Reference

#include <UserManager.h>

+ Collaboration diagram for UserManager:

Public Member Functions

void initialise ()
 
User * getUser (size_t id)
 
User * getUser (String name)
 
Group * getGroup (size_t id)
 
Group * getGroup (String name)
 

Static Public Member Functions

static UserManager & instance ()
 

Private Member Functions

 UserManager ()
 
 UserManager (const UserManager &)
 
UserManager & operator= (const UserManager &)
 
bool initialiseUsers ()
 
bool initialiseGroups ()
 
bool initialiseMemberships ()
 
void addUser (size_t uid, String username, String fullName, size_t group, String home, String shell)
 
void addGroup (size_t gid, String name)
 

Private Attributes

Tree< size_t, User * > m_Users
 
Tree< size_t, Group * > m_Groups
 

Static Private Attributes

static UserManager m_Instance
 

Detailed Description

The user manager provides lookups of users and groups.

Definition at line 29 of file UserManager.h.

Constructor & Destructor Documentation

◆ UserManager()

UserManager::UserManager ( )
private

Singleton class - default constructor hidden.

Definition at line 37 of file UserManager.cc.

◆ ~UserManager()

UserManager::~UserManager ( )
private

Definition at line 39 of file UserManager.cc.

Member Function Documentation

◆ addGroup()

void UserManager::addGroup ( size_t  gid,
String  name 
)
private

Definition at line 201 of file UserManager.cc.

◆ addUser()

void UserManager::addUser ( size_t  uid,
String  username,
String  fullName,
size_t  group,
String  home,
String  shell 
)
private

Definition at line 179 of file UserManager.cc.

◆ getGroup() [1/2]

Group * UserManager::getGroup ( size_t  id)

Look up a group by ID.

Definition at line 166 of file UserManager.cc.

References Tree< K, E >::lookup(), and m_Groups.

◆ getGroup() [2/2]

Group * UserManager::getGroup ( String  name)

Look up a group by name.

Definition at line 170 of file UserManager.cc.

References Tree< K, E >::begin(), Tree< K, E >::end(), Group::getName(), and m_Groups.

◆ getUser() [1/2]

User * UserManager::getUser ( size_t  id)

Look up a user by ID.

Definition at line 153 of file UserManager.cc.

References Tree< K, E >::lookup(), and m_Users.

Referenced by initialise().

+ Here is the caller graph for this function:

◆ getUser() [2/2]

User * UserManager::getUser ( String  name)

Look up a user by name.

Definition at line 157 of file UserManager.cc.

References Tree< K, E >::begin(), Tree< K, E >::end(), User::getUsername(), and m_Users.

◆ initialise()

void UserManager::initialise ( )

Loads the initial users and groups.

Definition at line 213 of file UserManager.cc.

References User::getDefaultGroup(), Process::getParent(), getUser(), and ProcessorBase::information().

◆ initialiseGroups()

bool UserManager::initialiseGroups ( )
private

Definition at line 69 of file UserManager.cc.

◆ initialiseMemberships()

bool UserManager::initialiseMemberships ( )
private

Definition at line 120 of file UserManager.cc.

◆ initialiseUsers()

bool UserManager::initialiseUsers ( )
private

Definition at line 94 of file UserManager.cc.

◆ instance()

static UserManager & UserManager::instance ( )
inlinestatic

Get the singleton instance.

Definition at line 32 of file UserManager.h.

Member Data Documentation

◆ m_Groups

Tree<size_t, Group*> UserManager::m_Groups
private

Dictionary of groups, indexed by ID.

Definition at line 66 of file UserManager.h.

Referenced by getGroup(), and getGroup().

◆ m_Instance

UserManager UserManager::m_Instance
staticprivate

Definition at line 68 of file UserManager.h.

◆ m_Users

Tree<size_t, User*> UserManager::m_Users
private

Dictionary of users, indexed by ID.

Definition at line 64 of file UserManager.h.

Referenced by getUser(), and getUser().


The documentation for this class was generated from the following files: