com::pcbsys::nirvana::nAdminAPI::nACLEntry Class Reference

Contains the mapping between a subject User@Host and the privileges they can perform on a secured object such as a Realm, Channel or Queue. More...

#include <nACLEntry.h>

Inheritance diagram for com::pcbsys::nirvana::nAdminAPI::nACLEntry:
com::pcbsys::nirvana::nAdminAPI::nChannelACLEntry com::pcbsys::nirvana::nAdminAPI::nInterfaceViaEntry com::pcbsys::nirvana::nAdminAPI::nRealmACLEntry com::pcbsys::nirvana::nAdminAPI::nServiceACLEntry

Public Member Functions

virtual bool canList ()
 Can this subject list the contents of an ACL. More...
 
virtual bool canModify ()
 Can this subject modify acl entries in a secure object. More...
 
void copyBitArray (BitArray *pArray)
 Replace the bit array representing the ACL with *pArray. More...
 
BitArray * getBitSet ()
 Creates a new nACLEntry with the subject being name@host. More...
 
virtual const std::string & getHost ()
 Returns the host's name as a string. More...
 
virtual const std::string & getName ()
 Returns the name of the ACLEntry. More...
 
std::string getSubject ()
 This method returns the completed subject User@Host. More...
 
virtual bool hasFullPrivileges ()
 Does this subject have full privileges for the secure object. More...
 
virtual bool lessThan (nACLEntry *pItem)
 Used to compares this Object with another to determine sorting position. More...
 
virtual bool lessThan (longlong aLong)
 Required as part of the SortedObject interface. More...
 
 nACLEntry (const std::string &name, const std::string &host)
 Creates a new nACLEntry with the subject being name@host. More...
 
 nACLEntry (const std::string &subject, BitArray *pBitset=NULL)
 Creates a new nACLEntry with the subject being name@host. More...
 
virtual void setFullPrivileges (bool val)
 Sets the subject to have full privileges for this secure object allowing the subject complete control over the secure object. More...
 
virtual void setList (bool val)
 Changes the current setting for this user to allow/disallow ACL listing. More...
 
virtual void setModify (bool val)
 Changes the current setting for this subject to allow/disallow modifying ACL. More...
 

Detailed Description

Contains the mapping between a subject User@Host and the privileges they can perform on a secured object such as a Realm, Channel or Queue.

On construction of these objects the name string can be set to "*" meaning All users and the host can also be set to "*". For example, all users from a host called test.com can be configured such as *@test.com or a more insecure method for allowing all administrators access would be administrator@* (Not recommended).

Constructor & Destructor Documentation

com::pcbsys::nirvana::nAdminAPI::nACLEntry::nACLEntry ( const std::string &  name,
const std::string &  host 
)

Creates a new nACLEntry with the subject being name@host.

There are no default permissions set so this subject can perform NO actions on the secured objects

Parameters
nameUsername/Token for the subject
hostthe host they can connect from
com::pcbsys::nirvana::nAdminAPI::nACLEntry::nACLEntry ( const std::string &  subject,
BitArray *  pBitset = NULL 
)

Creates a new nACLEntry with the subject being name@host.

There are no default permissions set so this subject can perform NO actions on the secured objects

Parameters
subjectUsername/Token for the subject
*pBitsetthe bitset denoting the permissions for this acl

Member Function Documentation

virtual bool com::pcbsys::nirvana::nAdminAPI::nACLEntry::canList ( )
virtual

Can this subject list the contents of an ACL.

Returns
a boolean indicating the current permission status for this user
virtual bool com::pcbsys::nirvana::nAdminAPI::nACLEntry::canModify ( )
virtual

Can this subject modify acl entries in a secure object.

Returns
a boolean indicating the current permission status for this user
void com::pcbsys::nirvana::nAdminAPI::nACLEntry::copyBitArray ( BitArray *  pArray)

Replace the bit array representing the ACL with *pArray.

Parameters
*pArraybit array representing an ACL
BitArray* com::pcbsys::nirvana::nAdminAPI::nACLEntry::getBitSet ( )

Creates a new nACLEntry with the subject being name@host.

There are no default permissions set so this subject can perform NO actions on the secured objects

Returns
the bitset denoting the permissions for this ACL
virtual const std::string& com::pcbsys::nirvana::nAdminAPI::nACLEntry::getHost ( )
virtual

Returns the host's name as a string.

Returns
a string containing the hostname
virtual const std::string& com::pcbsys::nirvana::nAdminAPI::nACLEntry::getName ( )
virtual

Returns the name of the ACLEntry.

Returns
String name
std::string com::pcbsys::nirvana::nAdminAPI::nACLEntry::getSubject ( )

This method returns the completed subject User@Host.

Returns
String representation of the subject
virtual bool com::pcbsys::nirvana::nAdminAPI::nACLEntry::hasFullPrivileges ( )
virtual

Does this subject have full privileges for the secure object.

This privilege enables the subject to perform ANY action against this secure object if set to true.

Returns
a boolean indicating the current permission status for this user
virtual bool com::pcbsys::nirvana::nAdminAPI::nACLEntry::lessThan ( nACLEntry pItem)
virtual

Used to compares this Object with another to determine sorting position.

Parameters
itemObject to compare
Returns
True if this object is less then the passed in object
virtual bool com::pcbsys::nirvana::nAdminAPI::nACLEntry::lessThan ( longlong  aLong)
virtual

Required as part of the SortedObject interface.

For internal use only

virtual void com::pcbsys::nirvana::nAdminAPI::nACLEntry::setFullPrivileges ( bool  val)
virtual

Sets the subject to have full privileges for this secure object allowing the subject complete control over the secure object.

WARNING: Use with great caution. Should only set what is required rather than this entry. By default the realm server will automatically set this for the default administrator

Parameters
valtrue for full, false otherwise
virtual void com::pcbsys::nirvana::nAdminAPI::nACLEntry::setList ( bool  val)
virtual

Changes the current setting for this user to allow/disallow ACL listing.

WARNING: Should be used in conjunction with ModifyACL

Parameters
valboolean specifying the permission status
virtual void com::pcbsys::nirvana::nAdminAPI::nACLEntry::setModify ( bool  val)
virtual

Changes the current setting for this subject to allow/disallow modifying ACL.

WARNING: Should not be given to normal subjects but only to subjects which need to administer the Secure Object.

Parameters
valboolean specifying the permission status