authenticate method
Adds the id
to the appropiate list (owners, controllers,
executors) based on the given authority
. Returns true if success,
false otherwise.
Implementation
bool authenticate(int id, Role authority) {
switch (authority) {
case Role.user:
executors.add(id);
return true;
case Role.securityOfficer:
controllers.add(id);
return true;
case Role.administrator:
owners.add(id);
return true;
}
return false;
}