8 #include "unisecuregen.h"
10 #include "wvstringlist.h"
14 #include "wvlinkerhack.h"
38 IUniConfGen *_perms = wvcreate<IUniConfGen>(permmon);
60 cred.user = _cred.user;
62 WvStringTable::Iter i(_cred.groups);
63 for (i.rewind(); i.next(); )
64 cred.groups.add(
new WvString(*i),
true);
72 WvStringList::Iter i(groups);
73 for (i.rewind(); i.next(); )
74 cred.groups.add(
new WvString(*i),
true);
94 if (findperm(key, UniPermGen::READ))
100 return WvString::null;
106 if (findperm(key.
removelast(), UniPermGen::EXEC))
114 if (findperm(key, UniPermGen::WRITE))
121 if (findperm(key, UniPermGen::EXEC))
146 {
return it->
next(); }
149 {
return it->
key(); }
155 return gen->
get(realkey);
166 if (findperm(key, UniPermGen::EXEC))
182 if (findperm(key, UniPermGen::EXEC))
191 if (findperm(key, UniPermGen::READ))
196 bool UniSecureGen::findperm(
const UniConfKey &key, UniPermGen::Type type)
201 return perms->getperm(key, cred, type);
205 bool UniSecureGen::drilldown(
const UniConfKey &key)
213 if (!perms->getperm(check, cred, UniPermGen::EXEC))
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
Functions to handle "tcl-style" strings and lists.
The basic interface which is included by all other XPLC interfaces and objects.
void delta(const UniConfKey &key, WvStringParm value)
Call this when a key's value or children have possibly changed.
virtual void commit()
Commits any changes.
An abstract data container that backs a UniConf tree.
virtual void commit()
Commits any changes.
virtual bool refresh()
Refreshes information about a key recursively.
An abstract iterator over keys and values in a generator.
virtual bool next()=0
Seeks to the next element in the sequence.
void append(const UniConfKey &other)
Appends a path to this path.
A type-safe version of WvMonikerBase that lets you provide create functions for object types other th...
virtual bool refresh()
Refreshes information about a key recursively.
virtual UniConfKey key() const
Returns the current key.
virtual bool haschildren(const UniConfKey &key)
Returns true if a key has children.
virtual void set(const UniConfKey &key, WvStringParm value)
Stores a string value for a key into the registry.
virtual bool exists(const UniConfKey &key)
Without fetching its value, returns true if a key exists.
virtual WvString value() const
Returns the value of the current key.
WvString wvtcl_getword(WvBuf &buf, const WvStringMask &splitchars=WVTCL_SPLITCHARS, bool do_unescape=true)
Get a single tcl word from an input buffer, and return the rest of the buffer untouched.
virtual UniConfKey key() const =0
Returns the current key.
bool isempty() const
Returns true if this path has zero segments (also known as root).
virtual WvString get(const UniConfKey &key)
Fetches a string value for a key from the registry.
UniSecureGen wraps a given generator and checks permissions (using a Unix-style scheme) before respon...
The const in place raw memory buffer type.
virtual void rewind()
Rewinds the iterator.
This is a WvList of WvStrings, and is a really handy way to parse strings.
virtual void rewind()=0
Rewinds the iterator.
UniConfKey removelast(int n=1) const
Returns the path formed by removing the last n segments of this path.
void setinner(IUniConfGen *inner)
Rebinds the inner generator and prepares its callback.
virtual void set(const UniConfKey &key, WvStringParm value)
Stores a string value for a key into the registry.
void prepend(const UniConfKey &other)
Prepends a path to this path.
A UniConfGen that delegates all requests to an inner generator.
virtual bool next()
Seeks to the next element in the sequence.
virtual WvString get(const UniConfKey &key)
Fetches a string value for a key from the registry.
virtual bool haschildren(const UniConfKey &key)
Returns true if a key has children.
UniConfKey first(int n=1) const
Returns the path formed by the n first segments of this path.
virtual Iter * recursiveiterator(const UniConfKey &key)
Like iterator(), but the returned iterator is recursive, that is, it will return children of the imme...
virtual Iter * recursiveiterator(const UniConfKey &key)
Like iterator(), but the returned iterator is recursive, that is, it will return children of the imme...
virtual Iter * iterator(const UniConfKey &key)
Returns an iterator over the children of the specified key.
WvString is an implementation of a simple and efficient printable-string class.
virtual Iter * iterator(const UniConfKey &key)
Returns an iterator over the children of the specified key.
UniPermGen wraps a tree encoding Unix-style permissions, and provides an API for setting and checking...
UniConfKey removefirst(int n=1) const
Returns the path formed by removing the first n segments of this path.
virtual bool exists(const UniConfKey &key)
Without fetching its value, returns true if a key exists.