Optimizing commandSecurityService.getContextForType

Prevent creating dummy command instances when checking authorization on commands.