def test_method_permission_override(self):
        """
        MVC: Test method permission name override
        """
        from flask_appbuilder import ModelView
        from flask_appbuilder.models.sqla.interface import SQLAInterface

        class Model1PermOverride(ModelView):
            datamodel = SQLAInterface(Model1)
            method_permission_name = {
                "list": "read",
                "show": "read",
                "edit": "write",
                "add": "write",
                "delete": "write",
                "download": "read",
                "api_readvalues": "read",
                "api_column_edit": "write",
                "api_column_add": "write",
                "api_delete": "write",
                "api_update": "write",
                "api_create": "write",
                "api_get": "read",
                "api_read": "read",
                "api": "read",
            }

        self.model1permoverride = Model1PermOverride
        self.appbuilder.add_view_no_menu(Model1PermOverride)

        role = self.appbuilder.sm.add_role("Test")
        pvm_read = self.appbuilder.sm.find_permission_view_menu(
            "can_read", "Model1PermOverride"
        )
        pvm_write = self.appbuilder.sm.find_permission_view_menu(
            "can_write", "Model1PermOverride"
        )
        self.appbuilder.sm.add_permission_role(role, pvm_read)
        self.appbuilder.sm.add_permission_role(role, pvm_write)

        user = self.appbuilder.sm.add_user(
            "test", "test", "user", "test@fab.org", role, "test"
        )

        client = self.app.test_client()
        self.browser_login(client, "test", "test")

        rv = client.post(
            "/model1permoverride/add",
            data=dict(
                field_string="tmp_test",
                field_integer="1",
                field_float="0.12",
                field_date="2014-01-01",
            ),
            follow_redirects=True,
        )
        self.assertEqual(rv.status_code, 200)
        model1 = (
            self.appbuilder.get_session.query(Model1)
            .filter_by(field_string="tmp_test")
            .one_or_none()
        )
        self.assertIsNotNone(model1)

        # Revert data changes
        self.appbuilder.get_session.delete(model1)
        self.appbuilder.get_session.commit()

        with model1_data(self.appbuilder.session, 2) as models:
            model_id = models[0].id
            # Verify write links are on the UI
            rv = client.get("/model1permoverride/list/")
            self.assertEqual(rv.status_code, 200)
            data = rv.data.decode("utf-8")
            self.assertIn(f"/model1permoverride/delete/{model_id}", data)
            self.assertIn("/model1permoverride/add", data)
            self.assertIn(f"/model1permoverride/edit/{model_id}", data)
            self.assertIn(f"/model1permoverride/show/{model_id}", data)

            # Delete write permission from Test Role
            role = self.appbuilder.sm.find_role("Test")
            pvm_write = self.appbuilder.sm.find_permission_view_menu(
                "can_write", "Model1PermOverride"
            )
            self.appbuilder.sm.del_permission_role(role, pvm_write)

            # Unauthorized delete
            model1 = (
                self.appbuilder.get_session.query(Model1)
                .filter_by(field_string="test1")
                .one_or_none()
            )
            pk = model1.id
            rv = client.get(f"/model1permoverride/delete/{pk}")
            self.assertEqual(rv.status_code, 302)
            model = self.db.session.query(Model1).filter_by(id=pk).one_or_none()
            self.assertEqual(model.field_string, "test1")

            # Verify write links are gone from UI
            rv = client.get("/model1permoverride/list/")
            self.assertEqual(rv.status_code, 200)
            data = rv.data.decode("utf-8")
            self.assertNotIn(f"/model1permoverride/delete/{model_id}", data)
            self.assertNotIn("/model1permoverride/add/", data)
            self.assertNotIn(f"/model1permoverride/edit/{model_id}", data)
            self.assertIn(f"/model1permoverride/show/{model_id}", data)

            # Revert data changes
            self.db.session.delete(self.appbuilder.sm.find_role("Test"))
            self.db.session.delete(user)
            self.db.session.commit()

        MVC: Test method permission name override
        
tests/test_mvc.py