Added permission check for a specific type instead of 'type'.