Fixing a bug in the admin permission granting logic