topical media & game development
professional-program-21-AccessControlList-AccessListTest.c
? /
professional-program-21-AccessControlList-AccessListTest.c
include <AccessList.h>
include <iostream>
include <iterator>
using namespace std;
int main(int argc, char** argv)
{
AccessList fileX;
fileX.addUser("nsolter");
fileX.addUser("klep");
fileX.addUser("baduser");
fileX.removeUser("baduser");
if (fileX.isAllowed("nsolter")) {
cout << "nsolter has permissions\n";
}
if (fileX.isAllowed("baduser")) {
cout << "baduser has permissions\n";
}
list<string> users = fileX.getAllUsers();
for (list<string>::const_iterator it = users.begin();
it != users.end(); ++it) {
cout << *it << " ";
}
cout << endl;
return (0);
}
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.