Anope IRC Services  Version 2.0
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Private Attributes
ChanAccess Class Referenceabstract

#include <access.h>

Inheritance diagram for ChanAccess:
Inheritance graph
Collaboration diagram for ChanAccess:
Collaboration graph

Public Types

typedef std::multimap< const ChanAccess *, const ChanAccess * > Set
typedef std::pair< Set, SetPath

Public Member Functions

 ChanAccess (AccessProvider *p)
virtual ~ChanAccess ()
void SetMask (const Anope::string &mask, ChannelInfo *ci)
const Anope::stringMask () const
NickCoreGetAccount () const
void Serialize (Serialize::Data &data) const anope_override
virtual bool Matches (const User *u, const NickCore *nc, Path &p) const
virtual bool HasPriv (const Anope::string &name) const =0
virtual Anope::string AccessSerialize () const =0
virtual void AccessUnserialize (const Anope::string &data)=0
virtual bool operator> (const ChanAccess &other) const
virtual bool operator< (const ChanAccess &other) const
bool operator>= (const ChanAccess &other) const
bool operator<= (const ChanAccess &other) const
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
void QueueUpdate ()
bool IsCached (Serialize::Data &)
void UpdateCache (Serialize::Data &)
bool IsTSCached ()
void UpdateTS ()
Serialize::TypeGetSerializableType () const
- Public Member Functions inherited from Base
 Base ()
virtual ~Base ()
void AddReference (ReferenceBase *r)
void DelReference (ReferenceBase *r)

Static Public Member Functions

static SerializableUnserialize (Serializable *obj, Serialize::Data &)
- Static Public Member Functions inherited from Serializable
static const std::list< Serializable * > & GetItems ()

Data Fields

Serialize::Reference< ChannelInfoci
Anope::string creator
time_t last_seen
time_t created
- Data Fields inherited from Serializable
uint64_t id
unsigned short redis_ignore

Private Attributes

Anope::string mask
Serialize::Reference< NickCorenc

Additional Inherited Members

- Protected Member Functions inherited from Serializable
 Serializable (const Anope::string &serialize_type)
 Serializable (const Serializable &)
Serializableoperator= (const Serializable &)

Detailed Description

Definition at line 75 of file access.h.

Member Typedef Documentation

◆ Path

typedef std::pair<Set, Set> ChanAccess::Path

Definition at line 87 of file access.h.

◆ Set

typedef std::multimap<const ChanAccess *, const ChanAccess *> ChanAccess::Set

Definition at line 82 of file access.h.

Constructor & Destructor Documentation

◆ ChanAccess()

ChanAccess::ChanAccess ( AccessProvider p)

Definition at line 142 of file access.cpp.

◆ ~ChanAccess()

ChanAccess::~ChanAccess ( )

Definition at line 146 of file access.cpp.

References ChannelInfo::Find(), mask, nc, and ChannelInfo::RemoveChannelReference().

Member Function Documentation

◆ AccessSerialize()

virtual Anope::string ChanAccess::AccessSerialize ( ) const
pure virtual

◆ AccessUnserialize()

virtual void ChanAccess::AccessUnserialize ( const Anope::string data)
pure virtual

Unserialize this access entry from the given data. This data will be fetched from AccessSerialize.

Implemented in XOPChanAccess, AccessChanAccess, and FlagsChanAccess.

Referenced by ChannelInfo::ChannelInfo(), CommandCSClone::Execute(), LoadChannels(), and WebCPanel::ChanServ::Access::OnRequest().

◆ GetAccount()

NickCore * ChanAccess::GetAccount ( ) const

Definition at line 204 of file access.cpp.

References nc.

Referenced by CommandCSAccess::DoDel(), ChanServCore::OnDelCore(), and CommandSeen::SimpleSeen().

◆ HasPriv()

virtual bool ChanAccess::HasPriv ( const Anope::string name) const
pure virtual

Check if this access entry has the given privilege.

nameThe privilege name

Implemented in AccessChanAccess, XOPChanAccess, and FlagsChanAccess.

Referenced by FlagsChanAccess::DetermineFlags(), XOPChanAccess::DetermineLevel(), HasPriv(), operator<(), and operator>().

◆ Mask()

const Anope::string & ChanAccess::Mask ( ) const

◆ Matches()

bool ChanAccess::Matches ( const User u,
const NickCore nc,
Path p 
) const

Check if this access entry matches the given user or account

uThe user
ncThe account
pThe path to the access object which matches will be put here

Definition at line 254 of file access.cpp.

References NickCore::aliases, ChannelInfo::Find(), Anope::string::find_first_of(), ChannelInfo::GetAccess(), ChannelInfo::GetAccessCount(), User::GetDisplayedMask(), IRCD, IRCDProto::IsChannelValid(), mask, Anope::Match(), Matches(), nc, NickAlias::nick, User::nick, and Anope::string::npos.

Referenced by ChannelInfo::AccessFor(), ChannelInfo::GetDeepAccessCount(), Matches(), and CommandCSAccess::ProcessList().

◆ operator<()

bool ChanAccess::operator< ( const ChanAccess other) const

Reimplemented in AccessChanAccess.

Definition at line 324 of file access.cpp.

References PrivilegeManager::GetPrivileges(), HasPriv(), and name.

Referenced by AccessChanAccess::operator<().

◆ operator<=()

bool ChanAccess::operator<= ( const ChanAccess other) const

Definition at line 346 of file access.cpp.

◆ operator>()

bool ChanAccess::operator> ( const ChanAccess other) const

Reimplemented in AccessChanAccess.

Definition at line 307 of file access.cpp.

References PrivilegeManager::GetPrivileges(), HasPriv(), and name.

Referenced by AccessChanAccess::operator>().

◆ operator>=()

bool ChanAccess::operator>= ( const ChanAccess other) const

Definition at line 341 of file access.cpp.

◆ Serialize()

void ChanAccess::Serialize ( Serialize::Data data) const

◆ SetMask()

void ChanAccess::SetMask ( const Anope::string mask,
ChannelInfo ci 

◆ Unserialize()

Serializable * ChanAccess::Unserialize ( Serializable obj,
Serialize::Data data 

Field Documentation

◆ ci

◆ created

time_t ChanAccess::created

◆ creator

Anope::string ChanAccess::creator

◆ last_seen

time_t ChanAccess::last_seen

◆ mask

Anope::string ChanAccess::mask

◆ nc

Serialize::Reference<NickCore> ChanAccess::nc

Definition at line 79 of file access.h.

Referenced by CommandCSXOP::DoDel(), GetAccount(), Mask(), Matches(), SetMask(), and ~ChanAccess().

◆ provider

AccessProvider* ChanAccess::provider

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