Fix error in secured categories scope

The entire application would crash after setting up more than one secure category. This tweaks the query to use `IN` rather than `=` when checking for the presence of a category ID in a list, and adds a test for that scope.