<!--
Welcome to Apache Airflow!

Please complete the next sections or the issue will be closed.
-->

**Apache Airflow version**: 2.0.2 and 2.1.1

<!-- AIRFLOW VERSION IS MANDATORY -->

**OS**: Debian

<!-- MANDATORY! You can get it via `cat /etc/oss-release` for example -->

**Apache Airflow Provider versions**: 
apache-airflow-providers-ftp==2.0.0
apache-airflow-providers-imap==2.0.0
apache-airflow-providers-sqlite==2.0.0

<!-- You can use `pip freeze | grep apache-airflow-providers` (you can leave only relevant ones)-->

**Deployment**: docker-compose

<!-- e.g. Virtualenv / VM / Docker-compose / K8S / Helm Chart / Managed Airflow Service -->

<!-- Please include your deployment tools and versions: docker-compose, k8s, helm, etc -->

**What happened**:

<!-- Please include exact error messages if you can -->

**What you expected to happen**:

Permissions for subdags should get listed on list roles on Airflow UI but only the parent dag get listed but not the children dags.

<!-- What do you think went wrong? -->

**How to reproduce it**:

Run airflow 2.0.2 or 2.1.1 with a subdag in the dags directory. And then try to find subdag listing on list roles on Airflow UI.

![subdag_not_listed](https://user-images.githubusercontent.com/9834450/129717365-9620895e-9876-4ac2-8adb-fc448183a78b.png)


<!--
As minimally and precisely as possible. Keep in mind we do not have access to your cluster or dags.
If this is a UI bug, please provide a screenshot of the bug or a link to a youtube video of the bug in action
You can include images/screen-casts etc. by drag-dropping the image here.
-->

**Anything else we need to know**:
It appears this problem is there most of the time.
<!--
How often does this problem occur? Once? Every time etc?
Any relevant logs to include? Put them here inside fenced
``` ``` blocks or inside a foldable details tag if it's long:
<details><summary>x.log</summary> lots of stuff </details>
-->

<!---
This is absolutely not required, but we are happy to guide you in contribution process
especially if you already have a good understanding of how to implement the fix.
Airflow is a community-managed project and we love to bring new contributors in.
Find us in #airflow-how-to-pr on Slack!
 -->

tests/www/test_security.py
public = self.appbuilder.sm.find_role("Public")
        assert public.permissions == []
    def test_verify_default_anon_user_has_no_accessible_dag_ids(self):
        with self.app.app_context():
            user = mock.MagicMock()
            user.is_anonymous = True
            self.app.config['AUTH_ROLE_PUBLIC'] = 'Public'
            assert self.app.appbuilder.sm.get_user_roles(user) == [self.app.appbuilder.sm.get_public_role()]
            self._create_dag("test_dag_id")
            self.security_manager.sync_roles()
            assert self.security_manager.get_accessible_dag_ids(user) == set()
    def test_verify_default_anon_user_has_no_access_to_specific_dag(self):
        with self.app.app_context():
            user = mock.MagicMock()
            user.is_anonymous = True
            self.app.config['AUTH_ROLE_PUBLIC'] = 'Public'
            assert self.app.appbuilder.sm.get_user_roles(user) == [self.app.appbuilder.sm.get_public_role()]
            dag_id = "test_dag_id"
            self._create_dag(dag_id)
            self.app.appbuilder.sm.sync_roles()
            assert self.app.appbuilder.sm.can_read_dag(dag_id, user) is False
            assert self.app.appbuilder.sm.can_edit_dag(dag_id, user) is False
            assert self._has_dag_perm(permissions.ACTION_CAN_READ, dag_id, user) is False
            assert self._has_dag_perm(permissions.ACTION_CAN_EDIT, dag_id, user) is False
    def test_verify_anon_user_with_admin_role_has_all_dag_access(self):