bug #4489 Incorrect detection of privileges for routine creation

Signed-off-by: Marc Delisle <marc@infomarc.info>