Base Framework
Public Types | Public Member Functions | List of all members
AccessControlList Class Reference

Access Control List (ACL). More...

#include <base/security/AccessControlList.h>

Inherits Object.

Public Types

typedef AccessControlEntry::Permissions Permissions
 

Public Member Functions

 AccessControlList () noexcept
 
 AccessControlList (const AccessControlList &copy) noexcept
 
AccessControlListoperator= (const AccessControlList &assign) noexcept
 
bool isEmpty () const noexcept
 
MemorySize getSize () const noexcept
 
bool add (const AccessControlEntry &entry, bool replace=false) noexcept
 
void remove (unsigned int index)
 
bool remove (const Trustee &trustee) noexcept
 
bool hasTrustee (const Trustee &trustee) const noexcept
 
const AccessControlEntrygetACE (const Trustee &trustee) const
 
const TrusteegetOwner () noexcept
 
void setOwner (const Trustee &owner) noexcept
 
const TrusteegetGroup () noexcept
 
void setGroup (const Trustee &group) noexcept
 
Permissions getEffectiveAccess (const Trustee &trustee) const noexcept
 
Array< AccessControlEntry >::ReadEnumerator getReadEnumerator () const noexcept
 

Detailed Description

Access Control List (ACL).

Access Control List (ACL).

See also
AccessControlEntry
Version
1.0

Member Typedef Documentation

◆ Permissions

Permissions.

Constructor & Destructor Documentation

◆ AccessControlList() [1/2]

AccessControlList::AccessControlList ( )
noexcept

Initialize ACL with no entries.

◆ AccessControlList() [2/2]

AccessControlList::AccessControlList ( const AccessControlList copy)
noexcept

Initializes object from other object.

Member Function Documentation

◆ add()

bool AccessControlList::add ( const AccessControlEntry entry,
bool  replace = false 
)
noexcept

Adds an entry to the ACL.

Parameters
entryThe access control entry.
replaceSpecifies whether to replace or merge (using the AND operator) the permissions. The default is to merge.
Returns
True, if the trustee already was contained within the ACL.

◆ getACE()

const AccessControlEntry& AccessControlList::getACE ( const Trustee trustee) const

Returns the access control entry for the specified trustee. Raises InvalidKey if no entry is available for the specified truste.

◆ getEffectiveAccess()

Permissions AccessControlList::getEffectiveAccess ( const Trustee trustee) const
noexcept

Returns the access of the trustee as specified by this ACL.

◆ getGroup()

const Trustee& AccessControlList::getGroup ( )
inlinenoexcept

Returns the associated primary group.

◆ getOwner()

const Trustee& AccessControlList::getOwner ( )
inlinenoexcept

Returns the associated owner.

◆ getReadEnumerator()

Array<AccessControlEntry>::ReadEnumerator AccessControlList::getReadEnumerator ( ) const
noexcept

Returns an enumerator for non-modifying access.

◆ getSize()

MemorySize AccessControlList::getSize ( ) const
inlinenoexcept

Returns the number of entries in the list.

◆ hasTrustee()

bool AccessControlList::hasTrustee ( const Trustee trustee) const
noexcept

Returns true if an entry is available for the specified trustee.

◆ isEmpty()

bool AccessControlList::isEmpty ( ) const
inlinenoexcept

Returns true if the ACL is empty.

◆ operator=()

AccessControlList& AccessControlList::operator= ( const AccessControlList assign)
noexcept

Assignment of object by object.

◆ remove() [1/2]

bool AccessControlList::remove ( const Trustee trustee)
noexcept

Removes a trustee from the list.

Returns
False, if the list has no entry for the specified trustee.

◆ remove() [2/2]

void AccessControlList::remove ( unsigned int  index)

Removes the entry at the specified index.

◆ setGroup()

void AccessControlList::setGroup ( const Trustee group)
inlinenoexcept

Set the associated primary group.

◆ setOwner()

void AccessControlList::setOwner ( const Trustee owner)
inlinenoexcept

Set the associated owner.