MaAuth Class Reference

Inheritance diagram for MaAuth:

MprLink List of all members.

Detailed Description

Authorization Class.

The MaAuth class is the foundation authorization class and is used as base class by MaDirectory and MaLocation. It stores the authorization configuration information required to determine if a client request should be permitted to the resource controlled by this object.

Stability classification:
Evolving.


Public Member Functions

int  addGroup (char *group, MaAcl acl, bool enable)
int  addUser (char *user, char *realm, char *passwd, bool enable)
int  addUsersToGroup (char *group, char *users)
int  disableGroup (char *group)
int  disableUser (char *user, char *realm)
int  enableGroup (char *group)
int  enableUser (char *user, char *realm)
MaAcl  getGroupAcl (char *group)
void  getGroups (MprStringList *list)
MaAcl  getRequiredAcl ()
void  getUsers (MprStringList *list)
void  insertAfter (MprLink *item)
  Insert after this member.

void  insertPrior (MprLink *item)
  Insert prior to this member.

bool  isGroupEnabled (char *group)
bool  isUserEnabled (char *user, char *realm)
MaAcl  parseAcl (char *aclStr)
int  removeGroup (char *group)
int  removeUser (char *user, char *realm)
int  removeUsersFromGroup (char *group, char *users)
void  reset ()
int  setGroupAcl (char *group, MaAcl acl)

Member Function Documentation

int MaAuth::addGroup char *  group,
MaAcl  acl,
bool  enable
 

Synopsis:
Add an authorization group.
Overview:
Add an authorization group to the MaAuth object.
Parameters:
group  Name of the authorization group.
acl  Access control list mask.
enable  If TRUE, enable the group.
Returns:
Returns zero if successful, otherwise a negative MPR error code.

int MaAuth::addUser char *  user,
char *  realm,
char *  passwd,
bool  enable
 

Synopsis:
Add an authorization user.
Overview:
Add an authorization user to the MaAuth object. The user + realm pair must be unique. Multiple user records with differing realms are allowed.
Parameters:
user  Name of the user to add.
realm  Name of the authorization realm.
passwd  Encrypted user password.
enable  If set to TRUE, the user+realm combination will be enabled.
Returns:
Returns zero if successful, otherwise a negative MPR error code.

int MaAuth::addUsersToGroup char *  group,
char *  users
 

Synopsis:
Add users to an authorization group.
Overview:
Add a list of users to to the specified authorization group.
Parameters:
group  Name of the authorization group.
users  List of users. User names are separated by white-space.
Returns:
Returns zero if successful, otherwise a negative MPR error code.

int MaAuth::disableGroup char *  group  ) 
 

Synopsis:
Disable a group.
Overview:
Disable an authorization group.
Parameters:
group  Name of the authorization group.
Returns:
Returns zero if successful, otherwise a negative MPR error code.

int MaAuth::disableUser char *  user,
char *  realm
 

Synopsis:
Disable a user.
Overview:
Disable an authorization user. User + Realm pairs are the

int MaAuth::enableGroup char *  group  ) 
 

Synopsis:
Enable a group.
Overview:
Enable an authorization group.
Parameters:
group  Name of the authorization group.
Returns:
Returns zero if successful, otherwise a negative MPR error code.

int MaAuth::enableUser char *  user,
char *  realm
 

Synopsis:
Enable a user.
Overview:
Enable an authorization user. User + realm pairs are the unique key.
Parameters:
user  Name of the authorization user.
realm  Name of the authorization realm.
Returns:
Returns zero if successful, otherwise a negative MPR error code.

MaAcl MaAuth::getGroupAcl char *  group  ) 
 

Synopsis:
Get an ACL mask for a group
Overview:
Get an Access Control List mask for a group.
Parameters:
group  Name of the authorization group.
Returns:
Returns the MaAcl mask.

void MaAuth::getGroups MprStringList *  list  ) 
 

Synopsis:
Get a list of the groups.
Overview:
Get a list of the authorization groups defined for this MaAuth object.
Parameters:
list  String list object to which the group names will be added.

MaAcl MaAuth::getRequiredAcl  ) 
 

Synopsis:
Get an ACL mask
Overview:
Get an Access Control List mask for this auth object.
Returns:
Returns the MaAcl mask.

void MaAuth::getUsers MprStringList *  list  ) 
 

Synopsis:
Get a list of the users.
Overview:
Get a list of the authorization users defined for this MaAuth object.
Parameters:
list  String list object to which the users names will be added.

bool MaAuth::isGroupEnabled char *  group  ) 
 

Synopsis:
Test if a group is enabled
Overview:
Return TRUE if the specified group is enabled.
Parameters:
group  Name of the authorization group.
Returns:
Returns TRUE if the group is enabled, otherwise FALSE.

bool MaAuth::isUserEnabled char *  user,
char *  realm
 

Synopsis:
Test if a user is enabled
Overview:
Return TRUE if the specified user + realm combination is enabled.
Parameters:
user  Name of the authorization user.
realm  Name of the authorization realm.
Returns:
Returns TRUE if the user is enabled, otherwise FALSE.

MaAcl MaAuth::parseAcl char *  aclStr  ) 
 

Synopsis:
Parse an ACL.
Overview:
Parse an ACL string into an ACL mask.
Parameters:
aclStr  Hex digit string representing the ACL mask.
Returns:
Returns the ACL.

int MaAuth::removeGroup char *  group  ) 
 

Synopsis:
Remove a group.
Overview:
Remove a group from the authorization configuration.
Parameters:
group  Name of the authorization group.
Returns:
Returns zero if successful, otherwise a negative MPR error code.

int MaAuth::removeUser char *  user,
char *  realm
 

Synopsis:
Remove a user.
Overview:
Remove a user from the authorization configuration.
Parameters:
user  Name of the authorization user.
realm  Name of the authorization realm.
Returns:
Returns zero if successful, otherwise a negative MPR error code.

int MaAuth::removeUsersFromGroup char *  group,
char *  users
 

Synopsis:
Remove users from an authorization group.
Overview:
Remove a set of users from the defined set of user members of a group.
Parameters:
group  Name of the authorization group.
users  List of users. User names are separated by white-space.
Returns:
Returns zero if successful, otherwise a negative MPR error code.

void MaAuth::reset  ) 
 

Synopsis:
Reset the authorization object.
Overview:
Reset the authorization object and discard all user and group authorization records.

int MaAuth::setGroupAcl char *  group,
MaAcl  acl
 

Synopsis:
Set the ACL mask.
Overview:
Set the Access Control List mask for an authorization group.
Parameters:
group  Name of the authorization group.
acl  Access control list mask.
Returns:
Returns zero if successful, otherwise a negative MPR error code.

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

© Mbedthis Software LLC, 2003-2004. All rights reserved. Mbedthis is a trademark of Mbedthis Software LLC.