zookeeper-cpp
ZooKeeper Client for C++
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Groups
zk::acl Class Referencefinal

An access control list is a wrapper around acl_rule instances. More...

#include <zk/acl.hpp>

Public Types

using iterator = std::vector< acl_rule >::iterator
 
using const_iterator = std::vector< acl_rule >::const_iterator
 
using size_type = std::size_t
 

Public Member Functions

 acl ()=default
 Create an empty ACL. Keep in mind that an empty ACL is an illegal ACL. More...
 
 acl (std::vector< acl_rule > rules) noexcept
 Create an instance with the provided rules. More...
 
 acl (std::initializer_list< acl_rule > rules)
 Create an instance with the provided rules. More...
 
size_type size () const
 The number of rules in this ACL. More...
 
void reserve (size_type capacity)
 Increase the reserved memory block so it can store at least capacity rules without reallocating. More...
 
template<typename... TArgs>
void emplace_back (TArgs &&...args)
 Construct a rule emplace on the end of the list using args. More...
 
const acl_ruleoperator[] (size_type idx) const
 
acl_ruleoperator[] (size_type idx)
 
const acl_ruleat (size_type idx) const
 
acl_ruleat (size_type idx)
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cend () const
 
void push_back (acl_rule &&x)
 
void push_back (const acl_rule &x)
 

Detailed Description

An access control list is a wrapper around acl_rule instances.

In general, the ACL system is similar to UNIX file access permissions, where znodes act as files. Unlike UNIX, each znode can have any number of ACLs to correspond with the potentially limitless (and pluggable) authentication schemes. A more surprising difference is that ACLs are not recursive: If /path is only readable by a single user, but /path/sub is world-readable, then anyone will be able to read /path/sub.

See ZooKeeper Programmer's Guide for more information.

See also
acls

Definition at line 139 of file acl.hpp.

Constructor & Destructor Documentation

zk::acl::acl ( )
default

Create an empty ACL. Keep in mind that an empty ACL is an illegal ACL.

zk::acl::acl ( std::vector< acl_rule rules)
noexcept

Create an instance with the provided rules.

Definition at line 112 of file acl.cpp.

zk::acl::acl ( std::initializer_list< acl_rule rules)
inline

Create an instance with the provided rules.

Definition at line 154 of file acl.hpp.

Member Function Documentation

const acl_rule& zk::acl::at ( size_type  idx) const
inline

Get the rule at the given idx.

Exceptions
std::out_of_rangeif the idx is larger than size.

Definition at line 173 of file acl.hpp.

iterator zk::acl::begin ( )
inline

Get an iterator to the beginning of the rule list.

Definition at line 179 of file acl.hpp.

template<typename... TArgs>
void zk::acl::emplace_back ( TArgs &&...  args)
inline

Construct a rule emplace on the end of the list using args.

See also
push_back

Definition at line 198 of file acl.hpp.

iterator zk::acl::end ( )
inline

Get an iterator to the end of the rule list.

Definition at line 186 of file acl.hpp.

const acl_rule& zk::acl::operator[] ( size_type  idx) const
inline

Get the rule at the given idx.

Definition at line 165 of file acl.hpp.

void zk::acl::push_back ( acl_rule &&  x)
inline

Add the rule x to the end of this list.

Definition at line 205 of file acl.hpp.

void zk::acl::reserve ( size_type  capacity)
inline

Increase the reserved memory block so it can store at least capacity rules without reallocating.

Definition at line 192 of file acl.hpp.

size_type zk::acl::size ( ) const
inline

The number of rules in this ACL.

Definition at line 161 of file acl.hpp.


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