9#include "unifiltergen.h"
10#include "wvstringtable.h"
32 enum Level { USER = 0, GROUP, WORLD };
35 enum Type { READ = 0, WRITE, EXEC };
60 {
return getperm(path, cred, READ); }
61 bool getwrite(
const UniConfKey &path,
const Credentials &cred)
62 {
return getperm(path, cred, WRITE); }
63 bool getexec(
const UniConfKey &path,
const Credentials &cred)
64 {
return getperm(path, cred, EXEC); }
66 bool getperm(
const UniConfKey &path,
const Credentials &cred, Type type);
68 void setread(
const UniConfKey &path, Level level,
bool read)
69 { setperm(path, level, READ, read); }
70 void setwrite(
const UniConfKey &path, Level level,
bool write)
71 { setperm(path, level, WRITE, write); }
72 void setexec(
const UniConfKey &path, Level level,
bool exec)
73 { setperm(path, level, EXEC, exec); }
75 void setperm(
const UniConfKey &path, Level level, Type type,
bool val);
88 bool getoneperm(
const UniConfKey &path, Level level, Type type);
An abstract data container that backs a UniConf tree.
Represents a UniConf key which is a path in a hierarchy structured much like the traditional Unix fil...
A UniConfGen that delegates all requests to an inner generator.
UniPermGen wraps a tree encoding Unix-style permissions, and provides an API for setting and checking...
bool getread(const UniConfKey &path, const Credentials &cred)
Return true if a user with the given credentials is allowed to read/write/exec the given path.
void setowner(const UniConfKey &path, WvStringParm owner)
get and set the owner for a path
void chmod(const UniConfKey &path, unsigned int owner, unsigned int group, unsigned int world)
Set permissions for path using Unix style chmod (with the second form, be sure to use octal)
virtual void flush_buffers()
Flushes any commitment/notification buffers .
void setgroup(const UniConfKey &path, WvStringParm group)
get and set the group for a path
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
WvString is an implementation of a simple and efficient printable-string class.