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))
The basic interface which is included by all other XPLC interfaces and objects.
An abstract data container that backs a UniConf tree.
An abstract iterator over keys and values in a generator.
virtual bool next()=0
Seeks to the next element in the sequence.
virtual void rewind()=0
Rewinds the iterator.
virtual UniConfKey key() const =0
Returns the current key.
void delta(const UniConfKey &key, WvStringParm value)
Call this when a key's value or children have possibly changed.
virtual Iter * recursiveiterator(const UniConfKey &key)
Like iterator(), but the returned iterator is recursive, that is, it will return children of the imme...
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
UniConfKey removefirst(int n=1) const
Returns the path formed by removing the first n segments of this path.
UniConfKey removelast(int n=1) const
Returns the path formed by removing the last n segments of this path.
void prepend(const UniConfKey &other)
Prepends a path to this path.
void append(const UniConfKey &other)
Appends a path to this path.
bool isempty() const
Returns true if this path has zero segments (also known as root).
UniConfKey first(int n=1) const
Returns the path formed by the n first segments of this path.
A UniConfGen that delegates all requests to an inner generator.
virtual void set(const UniConfKey &key, WvStringParm value)
Stores a string value for a key into the registry.
virtual WvString get(const UniConfKey &key)
Fetches a string value for a key from the registry.
virtual bool exists(const UniConfKey &key)
Without fetching its value, returns true if a key exists.
virtual bool refresh()
Refreshes information about a key recursively.
virtual void commit()
Commits any changes.
virtual Iter * iterator(const UniConfKey &key)
Returns an iterator over the children of the specified key.
virtual bool haschildren(const UniConfKey &key)
Returns true if a key has children.
UniPermGen wraps a tree encoding Unix-style permissions, and provides an API for setting and checking...
UniSecureGen wraps a given generator and checks permissions (using a Unix-style scheme) before respon...
virtual bool haschildren(const UniConfKey &key)
Returns true if a key has children.
virtual Iter * recursiveiterator(const UniConfKey &key)
Like iterator(), but the returned iterator is recursive, that is, it will return children of the imme...
virtual void set(const UniConfKey &key, WvStringParm value)
Stores a string value for a key into the registry.
virtual bool refresh()
Refreshes information about a key recursively.
virtual void commit()
Commits any changes.
virtual WvString get(const UniConfKey &key)
Fetches a string value for a key from the registry.
virtual Iter * iterator(const UniConfKey &key)
Returns an iterator over the children of the specified key.
virtual bool exists(const UniConfKey &key)
Without fetching its value, returns true if a key exists.
The const in place raw memory buffer type.
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
A type-safe version of WvMonikerBase that lets you provide create functions for object types other th...
This is a WvList of WvStrings, and is a really handy way to parse strings.
WvString is an implementation of a simple and efficient printable-string class.
virtual void rewind()
Rewinds the iterator.
virtual WvString value() const
Returns the value of the current key.
virtual UniConfKey key() const
Returns the current key.
virtual bool next()
Seeks to the next element in the sequence.
Functions to handle "tcl-style" strings and lists.
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.