Improved 'isAllowed()' method.