Add type documentation to core_sieve

Adds type documentation to core_sieve. Also adds a 'break' statement to the permissions checking, when we have a valid permission.