def _get_one_by_name_or_id(
        self,
        name_or_id,
        requester_user,
        permission_type,
        exclude_fields=None,
        include_fields=None,
        from_model_kwargs=None,
    ):
        """
        :param exclude_fields: A list of object fields to exclude.
        :type exclude_fields: ``list``
        :param include_fields: A list of object fields to include.
        :type include_fields: ``list``
        """

        instance = self._get_by_name_or_id(
            name_or_id=name_or_id,
            exclude_fields=exclude_fields,
            include_fields=include_fields,
        )

        if permission_type:
            rbac_utils = get_rbac_backend().get_utils_class()
            rbac_utils.assert_user_has_resource_db_permission(
                user_db=requester_user,
                resource_db=instance,
                permission_type=permission_type,
            )

        if not instance:
            msg = 'Unable to identify resource with name_or_id "%s".' % (name_or_id)
            abort(http_client.NOT_FOUND, msg)

        from_model_kwargs = from_model_kwargs or {}
        from_model_kwargs.update(self.from_model_kwargs)
        result = self.model.from_model(instance, **from_model_kwargs)

        return result

        :param exclude_fields: A list of object fields to exclude.
        :type exclude_fields: ``list``
        :param include_fields: A list of object fields to include.
        :type include_fields: ``list``
        
st2api/st2api/controllers/resource.py