topical media & game development

talk show tell print

professional-program-21-AccessControlList-AccessList.c

? / professional-program-21-AccessControlList-AccessList.c


  include <AccessList.h>
  using namespace std;
  
  void AccessList::addUser(const string& user)
  {
    mAllowed.insert(user);
  }
  
  void AccessList::removeUser(const string& user)
  {
    mAllowed.erase(user);
  }
  
  bool AccessList::isAllowed(const string& user) const
  {
    return (mAllowed.count(user) == 1);
  }
  
  list<string> AccessList::getAllUsers() const
  {
    list<string> users;
    users.insert(users.end(), mAllowed.begin(), mAllowed.end());
    return (users);
  }
  


(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.