Revert "->permission() sanitizing: don't pass flags to generic_permission()"

This reverts commit a2be92b15b5f15add9e7445a04d5895c6e51e740.