I'm not sure if that's the correct fix (UBB::SecurityToken::has_permission() is not easy to understand), but there are other places in the script where has_permission() is checked in a similar manner. Those could have the same problem (if it is a problem).